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:
Related
Overview: I have a QListView that displays the names of cities. I use MultiSelection as my selection type so the user can single click on a line to select a city, or multiple cities, without having to use Ctrl. MultiSelection allows the user to click and drag over items in the QListView, but it doesn't trigger a click event, so in another window where I display ONLY the user's selected items, it doesn't update to show what the user just selected. If the user then selects another city, then the click event is triggered and the full list of selected indices gets sent to the QListView object that displays the user's selections.
Problem: I need to be able to ensure that a click event occurs following the users drag-selection, so that the list displaying the selected indices is updated.
I didn't include any code because you either know or you don't know how this is done.
As #musicmante says, using selectionModel and selectionChanged is the way to go, but keep in mind that every time you invoke the setModel method, it resets the selectionModel. So anywhere you're using setModel, it would need to have this after it:
yourQListView.setModel(to_whatever)
yourQListView.selectionModel().selectionChanged.connect(theMethodYouWantToRun)
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.
I want a simple example for creating listview with button from inside python and with key press event in kivy.
Like this
I have one other conceptual question regarding ListView button and an ordinary button.
I made multiple ordinary buttons in a page which looks and feel similar to listview buton. My question is which is computationlly better multiple ordinary buttons or a listview?
I have created gui using pyqt4 designer and covert to this ui to .py but I am unable to access radio button value and also wanna check which radio button is checked using python.
i tried following code :
a= radiobutton.get()
I can not get the value.
Please help me
The correct method is isChecked:
a = radiobutton.isChecked()
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?