PDA

View Full Version : qcombobox scroll arrow problem



mekalapandiyan@gmail.com
24th January 2013, 07:06
In my application, i am using QCombobox & QPushbutton. First time combobox will have 500 items.
When i click combo, it will show all the items with top & bottom arrow to scroll.

After i press pushbutton, i will clear all items in the combo, and add only 5 items.
then i press combo, still its showing top & bottom arrow to scroll.

I don't want that scroll arrow, when 5 items is present in the combo.
i want to clear this scroll property.

Could anyone please help this issue?

mekalapandiyan@gmail.com
25th January 2013, 05:22
Please find my sample program,

Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
this->addItems();
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(slot_pushbuttonpressed()));
}

Dialog::~Dialog()
{
delete ui;
}

void Dialog::addItems()
{
for(int i = 0 ; i < 500; i++)
{
QString data = "Test_"+QString::number(i);

ui->comboBox->addItem(data);
}
}

void Dialog :: slot_pushbuttonpressed()
{
ui->comboBox->clear();
for(int i = 0 ; i < 5; i++)
{
QString data = "Test_"+QString::number(i);

ui->comboBox->addItem(data);
}
}

Santosh Reddy
25th January 2013, 05:57
arrow don't appear on my windows/Qt 4.8.1
can you show screenshot and QT versions

mekalapandiyan@gmail.com
28th January 2013, 08:07
Please find the screenshot.

8639

please find it

Santosh Reddy
28th January 2013, 08:16
I mean screenshot of QComboBox scroll arrow