Results 1 to 5 of 5

Thread: qcombobox scroll arrow problem

  1. #1
    Join Date
    Jan 2013
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question qcombobox scroll arrow problem

    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?

  2. #2
    Join Date
    Jan 2013
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qcombobox scroll arrow problem

    Please find my sample program,

    Dialog:ialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui:ialog)
    {
    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);
    }
    }

  3. #3
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: qcombobox scroll arrow problem

    arrow don't appear on my windows/Qt 4.8.1
    can you show screenshot and QT versions
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  4. #4
    Join Date
    Jan 2013
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qcombobox scroll arrow problem

    Please find the screenshot.

    Screenshot.jpg

    please find it

  5. #5
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: qcombobox scroll arrow problem

    I mean screenshot of QComboBox scroll arrow
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. QcomboBox hide the drop down arrow
    By Mrdata in forum Newbie
    Replies: 6
    Last Post: 5th October 2018, 04:05
  2. Replies: 1
    Last Post: 9th August 2011, 02:48
  3. QDial disabling key scroll and mouse wheel scroll
    By ldg20 in forum Qt Programming
    Replies: 2
    Last Post: 3rd June 2010, 00:05
  4. Scroll Bar Problem
    By zgulser in forum Qt Programming
    Replies: 11
    Last Post: 3rd December 2009, 17:32
  5. QComboBox: remove drop Down Arrow
    By GuS in forum Qt Programming
    Replies: 2
    Last Post: 30th May 2008, 05:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.