pyqt5

How to force screen-snip size ratio. PyQt5

喜你入骨 提交于 2021-01-29 06:43:43
问题 I want to modify Screen-Snip code from GitHub/harupy/snipping-tool so that every screen-snip has a ratio of 3 x 2. (I will save as 600 x 400 px image later) I'm not sure how to modify self.end dynamically so that the user clicks and drags with a 3 x 2 ratio. The mouse position will define the x coordinate, and the y coordinate will be int(x * 2/3) Any suggestions on how to do this? I promise I've been researching this, and I just can't seem to "crack the code" of modifying only the y

Making a specified table using pyqt5 designer

半腔热情 提交于 2021-01-29 03:57:34
问题 I want to make a specific table like shown in the picture below using pyqt designer and I coulnd't make a good result. I want to make this table in a window and contains the same elements and same dimensions. I tried to use layouts using LineEdits and Qlabels but I couldnt make it too . Thank you. 回答1: Premise: your question didn't show lots of research efforts, and from what was said it's quite clear that you're still a bit inexperienced; this will probably make this answer very complicated,

PyQt5 Gui Thread to worker Thread signal/Slot

浪尽此生 提交于 2021-01-29 01:51:07
问题 I am trying to make a simple communication between a worker thread, in this case it is called WorkToDo via the PyQt5 Signals and Slots mechanism. I can reliably send data from the Worker to the Gui thread via this mechanism, but I cannot do the same to the gui thread. From my research I have found that this is due to the fact that I have overridden the run function with my own logic. My question, is there any way to manually handle the execution of signals in the worker thread? Is there a

PyQt5 Gui Thread to worker Thread signal/Slot

给你一囗甜甜゛ 提交于 2021-01-29 01:47:38
问题 I am trying to make a simple communication between a worker thread, in this case it is called WorkToDo via the PyQt5 Signals and Slots mechanism. I can reliably send data from the Worker to the Gui thread via this mechanism, but I cannot do the same to the gui thread. From my research I have found that this is due to the fact that I have overridden the run function with my own logic. My question, is there any way to manually handle the execution of signals in the worker thread? Is there a

PyQt5 Gui Thread to worker Thread signal/Slot

烈酒焚心 提交于 2021-01-29 01:47:30
问题 I am trying to make a simple communication between a worker thread, in this case it is called WorkToDo via the PyQt5 Signals and Slots mechanism. I can reliably send data from the Worker to the Gui thread via this mechanism, but I cannot do the same to the gui thread. From my research I have found that this is due to the fact that I have overridden the run function with my own logic. My question, is there any way to manually handle the execution of signals in the worker thread? Is there a

Highlight date interval in a Qt5 Calendar Widget

谁说胖子不能爱 提交于 2021-01-29 00:32:18
问题 I want to highlight every day in a CalendarWidget that is between a selected start and end date. My problem is that a CalendarWidget only allows SingleSelection in QTCreator but says that other things can be changed programmatically though. I found some hints to use a QPainter and the paintCell() Method but i till dont know where to begin. The Internet wasn't helpful in my case. I tried to change a single date first on buttonClick but even this didnt work, can you give me an advice how to use

QGraphicScene Background

风流意气都作罢 提交于 2021-01-28 19:22:46
问题 I'm learning PyQt5 to develop a small academy project. I need to set a background for the QGraphicScene, but I'm not able to make the image fit well into the scene. It is sometimes repeaded or too large depending on the scale I apply. Here is my code: class MainWindow(QWidget): def __init__(self): super().__init__() self.title = "title"; self.top = 100 self.left = 100 self.width = 1500 self.height = 900 self.initUI() def initUI(self): scene = QGraphicsScene(0, 0, width, heigth) view =

QStyledItemDelegate truncates text horizontally and doesn't add a horizontal scroll bar

混江龙づ霸主 提交于 2021-01-28 19:08:29
问题 I got the following code, which I slightly modified, as an answer on how to use HTML formatted text in a QListWidget. main.ui <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>Dialog</class> <widget class="QDialog" name="Dialog"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>341</width> <height>161</height> </rect> </property> <property name="windowTitle"> <string>Dialog</string> </property> <widget class="QWidget" name="verticalLayoutWidget"> <property name=

QListView.indexAt in PyQt5 returning wrong index?

孤街浪徒 提交于 2021-01-28 14:51:56
问题 I'm trying to pop up a context menu when a user right-clicks on an item in a QListView and a different context menu if the user right-clicks outside of any of the items (any of the whitespace). What I'm finding is that the index I'm receiving when performing the indexAt command is not accurate, and I can't figure out why. I initialize the QListView as its own class: class RBKDataTypesTab(QWidget): def __init__(self): super().__init__() self.models = [] grid = QGridLayout() self.list =

QListView.indexAt in PyQt5 returning wrong index?

妖精的绣舞 提交于 2021-01-28 14:49:49
问题 I'm trying to pop up a context menu when a user right-clicks on an item in a QListView and a different context menu if the user right-clicks outside of any of the items (any of the whitespace). What I'm finding is that the index I'm receiving when performing the indexAt command is not accurate, and I can't figure out why. I initialize the QListView as its own class: class RBKDataTypesTab(QWidget): def __init__(self): super().__init__() self.models = [] grid = QGridLayout() self.list =