qcombobox

Getting all items of QComboBox - PyQt4 (Python)

梦想与她 提交于 2020-06-25 07:29:03
问题 I have A LOT of QComboBoxes , and at a certain point, I need to fetch every item of a particular QComboBox to iterate through. Although I could just have a list of items that correspond to the items in the QComboBox , I'd rather get them straight from the widget itself (there are a huge amount of QComboBoxes with many items each). Is there any functions / methods that will do this for me? (Eg: QComboBoxName.allItems() ) I've looked through the class reference but couldn't find anything

Getting all items of QComboBox - PyQt4 (Python)

て烟熏妆下的殇ゞ 提交于 2020-06-25 07:28:19
问题 I have A LOT of QComboBoxes , and at a certain point, I need to fetch every item of a particular QComboBox to iterate through. Although I could just have a list of items that correspond to the items in the QComboBox , I'd rather get them straight from the widget itself (there are a huge amount of QComboBoxes with many items each). Is there any functions / methods that will do this for me? (Eg: QComboBoxName.allItems() ) I've looked through the class reference but couldn't find anything

Using QComboBox to select different set of widgets displayed in PyQt5 / PySide2

回眸只為那壹抹淺笑 提交于 2020-06-08 12:41:12
问题 I'm working on an image viewer with a toolbar on the left. As I have many measures to make but want to use most of the display for the picture and keep the toolbar thin, I would like to use combo_box1 and combo_box2 to select the different widgets displayed in the toolbar. Example 1: if I choose measurements set 1 in combo_box1 I would then be able to choose between measurements P1-P2 and P3-P4 in combo_box2 . Example 2: if I choose measurements set 2 in combo_box1 I would then be able to

QComboBox click event

匆匆过客 提交于 2020-04-06 07:43:29
问题 I have been trying to get a QComboBox in PyQt5 to become populated from a database table. The problem is trying to find a method that recognizes a click event on it. In my GUI, my combo-box is initially empty, but upon clicking on it I wish for the click event to activate my method for communicating to the database and populating the drop-down list. It seems so far that there is no built-in event handler for a click-event for the combo-box. I am hoping that I am wrong on this. I hope someone

How to reach content in QTreeWidget second colum QComboBox?

喜你入骨 提交于 2020-02-15 10:17:21
问题 I have an AppDialog(QtGui.QWidget) containing a QtreeWidget . self.tree = QtGui.QTreeWidget() I populate data from self.sequences to this QtreeWidget with the function seqTree . Datas from self.sequences : {'090': {'090-0010': [ {'code': '090-0010_v000', 'type': 'Version', 'id': 26676, 'entity.Shot.sg_sequence.Sequence.code': '090', 'entity.Shot.code': '090-0010'}, {'code': '090-0010_maquette_v001', 'type': 'Version', 'id': 27848, 'entity.Shot.sg_sequence.Sequence.code': '090', 'entity.Shot

Get QComboBox item text triggered by event in separate class method/function

妖精的绣舞 提交于 2020-01-24 19:39:12
问题 I'm having trouble getting any information from a QComboBox other than the index in a function. Most similar examples provides the function in the same class as the triggered event. I'm trying to get this from an external class (and file). Folder structure is as provided in the answer here: PySide2 paint on widget created by designer In paintEventTest.py I've created a list which is used to populate the combobox with items. ComboEvent is instantiated from EventMethods.py and I'm trying to

remove items from QComboBox from ui

蹲街弑〆低调 提交于 2020-01-23 00:40:10
问题 I am trying to tweak the ui of a QComboBox in a way that the user can remove items from the drop down list (without first selecting them). The background is that I am using the QComboBox to indicate which data file is open right now. I am also using it as a cache for recently opened files. I would like the user to be able to remove entries he does not want to have listed anymore. This could be either by just hitting the delete key, or a context menu, or whatever is straightforward to

Preventing QComboboxView from autocollapsing when clicking on QTreeView item

百般思念 提交于 2020-01-16 01:19:10
问题 I'm using python3 + PyQt5. In my program I have QCombobox and a QTreeView inside that combobox. The QCOmbobox default behavior is to hide the dropdown list when an item is clicked. However, in my case there is not a simple list inside it, but a TreeView. So when I'm clicking an Expand Arrow in it, QCombobox hides the view so I can not select an item I have no any specific code here, just widget initialization. I know that there are signals and slots so my guess here is that combobox catches

How to make QComboBox popup upwards?

我们两清 提交于 2020-01-14 07:12:14
问题 my QComboBox -derived class lives in a QGraphicsScene at the bottom end of the (visible) screen - but it pops up downwards, thus out of view. (How) is it possible to force the popup to open above the widget? I've tried re-implementing showPopup like this: void MyComboBox::showPopup() { QAbstractItemView *popupView = view(); popupView->move(0,-100); //popupView->window->move(0,-100); QComboBox::showPopup(); } The result is, that the content seems to be shifted, but not the underlying popup

PyQt Different colors in a single row in a combobox

我的梦境 提交于 2020-01-11 06:30:37
问题 I'm developing a UI using PyQt where a single item in my Qcombobox can have two or three words separated by commas. So for eg item 1 can be ' Text1, Text2, Text3 ' and item 2 will be ' Text4, Text5 '. What I want to do is give multiple background colors to the items separated by the ',' in the itemText. So, in case of item 1 (' Text1, Text2, Text3 ') I would need a color behind Text1 , a different one behind Text2 and a third one behind Text3 . Similarly, item 2 would have 2 background colors