Results 1 to 2 of 2

Thread: Problem with QComboBox

  1. #1
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Problem with QComboBox

    Hi
    I just installed Qtopia 4.3.0 and was verifying the UI properties of various widgets.
    On QComboBox, if I do a setEditable(true) and configure its LAF using stylesheets, the lineedit seems to be taking up the entire space....i press and F4, i see the drop down, but the dropdown button itself is not being visible and hence not accessible.
    The following is what i did:

    QComboBox* iCombo = new QComboBox(this);
    iCombo->setGeometry(20, 70, 130, 20);
    QString str("1,2,3,4,5,6,7,8,9,0");
    QStringList list = str.split(",");
    iCombo->addItems(list);
    iCombo->setEditable(true);
    iCombo->setMaxVisibleItems(5);
    iCombo->setInsertPolicy(QComboBox::NoInsert);
    iCombo->lineEdit()->setText("number:");
    iCombo->setStyleSheet(" * {color:#ff0000; background-color: #000000; border: 1px outset #0000ff;} :focus {color: #00ff00; background-color: #ffffff; border: 1px outset #ff0000;}");

    I am kinda newbie to all this stylesheet stuff and also QT stuff and dont even get a hint as to what could be going wrong
    Let your work talk for you

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with QComboBox

    If you use stylesheets on a combobox, you have to style everything - including the drop-down button (::drop-down subcontrol). At least set its position. See the docs for examples.

  3. The following user says thank you to wysota for this useful post:

    jogeshwarakundi (8th December 2007)

Similar Threads

  1. QComboBox drop list button events
    By maird in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2007, 19:25
  2. Graphics view display problem.
    By kiranraj in forum Qt Programming
    Replies: 3
    Last Post: 20th July 2007, 07:08
  3. using QComboBox as an ItemView
    By EricTheFruitbat in forum Qt Programming
    Replies: 3
    Last Post: 24th January 2007, 16:14
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.