I'm a beginner with QT/PyQt4, and I'm trying to make a QListView display custom objects.
It should :
Have custom row widgets that display more than one line of text, possibly images
Trigger a modal dialog instead of the inline edit field whenever I double-click on an item
A QItemDelegate seems like the right choice, but I can't figure out how to use it properly for either #1 or #2. Any ideas?
Related
I am trying to make a drop-down menu which supports an image on the left side, then two labels on top of each other, these also need to be different sized, and then on the initial button to open the menu, a down arrow on the right side.
For reference purposes, I am trying to clone the Outlook drop-down option in the Info Frame
Tkinter menus don't support that. You will have to create your own dropdown window and then managing all of the bindings for making it appear and disappear.
While in runtime (I mean, while the user operates the application), I would like to know if is it possible, usind Tkinter, add an sub-menu item to an existing menu, and link the new sub-menu to some code.
Im not sure what this is called, so its hard to lookup. I want to get a set of images that have a unique identifier and the put some corresponding text information next to it, inside of an application. When more images are loading a scroll bar can go through them. I dont know which methods or how this is possible. For example, through other threads i found how to load images using a list widget and switching the items to an icon. However with this method I dont see how to put text next to it. Can this be done with a table, or a tree? I have been using qt Designer but I dont see anything like this available.
You can use QListWidget for that. Each item would represent an image (item's icon) and all text to the right of it. Define iconSize property of list widget to enlarge item icons. Use \n in item texts to add line breaks.
I am working with python plugins.I designed my form using PYQT4 designer.I used two QCalendarWidget on my form.
I retrieved selected values of calendar using
date1 = self.calendarWidget.selectedDate()
But i wanted to make calendar invisible on load of the form.Once you click specific radio button,calendar should be visible.I tried googling but did not get visibility property of QCalendarWidget .
How do i make that??
You can use show(), hide(), setVisible(is_visible), etc... functions of base QWidget.
List of All Members for QCalendarWidget
So, when you are initializing widgets, call self.calendarWidget.hide(). Then in radio button toggled handler, call self.calendarWidget.show() or self.calendarWidget.setVisible(True)
Also, you can connect radio button toggled(bool) signal, to QWidget.setVisible(bool) slot in QtDesigner:
I'd like to create a ListBox in wxPython with the same semantics as a multiple select box in HTML. Specifically I'd like the following semantics
When the user clicks on an entry in the list, all other entries become de-selected and the clicked entry becomes selected. If the entry was already selected then it stays selected.
When the user holds down the Ctrl key while clicking on an entry, all other entries stay unchanged, but it toggles whether the clicked entry is selected.
When the user holds down shift and clicks on an entry, that entry and every entry between it and the last clicked entry become selected.
In Java I get this by using the JList class in Swing and setting the selection mode to MULTIPLE_INTERVAL_SELECTED. I assume that there's a way to do this with the wxPython toolkit, but I can't figure out how to get a ListBox or ListCtrl or any other class to do this short of doing an enormous amount of event-driven programming myself.
I think what you're looking for is the wxLB_EXTENDED list box style. Specify style = wx.LB_EXTENDED when you create the ListBox.
You can then use the GetSelections method to obtain a list of the selected items.