In this article we will see how to change the size and font of the item present in the editable box. If we use
setFont method which takes QFont object as argument, using it with the check box object will change the font of all the items present in the list.
Note : When we get the line edit object from the combo box it will make the combo box there fore there is a need to make the line edit non editable
In order to change the font and size of only the item which is in the editable box, do the following –
1. Create a combo box
2. Get the line edit(editable box) object from combo box
3. Change the font of the line edit using
4. Make the line edit non-editable(read-only)
Below is the implementation –
- PyQt5 - Setting font to the item in line edit box of ComboBox
- PyQt5 - Setting font to all the items in ComboBox
- PyQt5 - Setting role to item in ComboBox
- PyQt5 - Setting different toolTip to different item of ComboBox
- PyQt5 - Setting line edit to the ComboBox
- PyQt5 QSpinBox - Matching font with the System Font
- PyQt5 - Getting the role of selected item in ComboBox
- PyQt5 - Getting the current index of selected item in ComboBox
- PyQt5 - Change the item at specific index in ComboBox
- PyQt5 - How to add an item to the ComboBox ?
- PyQt5 - Getting the text of selected item in ComboBox
- PyQt5 - Accessing role of item in ComboBox
- PyQt5 - Getting the content of item at specific index in ComboBox
- PyQt5 - Finding the item through text in ComboBox
- PyQt5 - Finding item through their role in comboBox
- PyQt5 - Adding item at given index in ComboBox
- PyQt5 - Get the icon of desired item in ComboBox
- PyQt5 - Get the icon size of item icon in ComboBox
- PyQt5 - Set icon size of item icon in ComboBox
- PyQt5 - How to set icon to the each item in ComboBox
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.