PyQt - ComboBox additems

Post here if you need help with creating a Graphical User Interface in Python.

PyQt - ComboBox additems

Postby bibibo » Sun Jan 19, 2014 2:17 pm

Hello, i am Python's beginner and this is my first application. I use QStyle "windows" and there is a problem with items in ComboBox. In the ComboBox's items are 24 numbers from list, but there are a dots instead numbers. If i choose a dots, number appears. Could you help me ?

Code: Select all
self.hodiny_default = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11"
                          , "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"]

self.comboBox_hod1_1.addItems(self.hodiny_default)

Attachments
photo.JPG
photo.JPG (36.57 KiB) Viewed 526 times
Last edited by stranac on Sun Jan 19, 2014 2:27 pm, edited 1 time in total.
Reason: First post lock.
bibibo
 
Posts: 2
Joined: Mon Jan 13, 2014 8:21 pm

Re: PyQt - ComboBox additems

Postby bibibo » Sun Jan 19, 2014 7:15 pm

I tried on Windows 7 and there is no problem. Problem is on my Linux Mint.
bibibo
 
Posts: 2
Joined: Mon Jan 13, 2014 8:21 pm

Re: PyQt - ComboBox additems

Postby XndrK » Fri Jan 24, 2014 1:49 am

I know this is beside the point, but you can take (still) screenshots by hitting the Print Screen button (often abbreviated to PrntScr or something along those lines). Just thought I'd let you know.
Proverbs 26:14 describes me a bit too well.

Version: Python 2.7.5

https://github.com/4of92000
https://github.com/PythonForum/
User avatar
XndrK
 
Posts: 173
Joined: Sat Jun 15, 2013 7:57 pm

Re: PyQt - ComboBox additems

Postby metulburr » Fri Jan 24, 2014 1:55 am

i am not sure without seeing the full code, but this i have no problem on windows or linux

Code: Select all
from PyQt4 import QtGui
from PyQt4 import QtCore
import sys

class Form(QtGui.QDialog):
    def __init__(self, parent = None):
        #super(Form,self).__init__(parent)
        QtGui.QDialog.__init__(self, parent)
        testlabel = QtGui.QLabel('Test01')
        testCombo = QtGui.QComboBox()
        for i in range(23):
            testCombo.addItem(str(i))
       
        grid = QtGui.QGridLayout()
        grid.addWidget(testlabel,0,0)
        grid.addWidget(testCombo, 0,1)
        self.setLayout(grid)
       
def main():
    app = QtGui.QApplication(sys.argv)
    form = Form()
    form.show()
    sys.exit(app.exec_())

if __name__ == '__main__':
    main()
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1562
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to GUI

Who is online

Users browsing this forum: Yoriz and 1 guest