Results 1 to 7 of 7

Thread: QCombobox remove checkbox

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: QCombobox remove checkbox

    Then it must be a bug in the style somewhere.
    Probably a wrong condition in an "if" statement, and there you have your checkboxes.

    Just saying... I am not sure exactly if that is the error, but the style is definitely to blame.

    Regards

  2. #2
    ucomesdag Guest

    Default Re: QCombobox remove checkbox

    Seems that setting any style on Linux generates check boxes with QCombobox.
    When using view() it seems to set all possible option, I noticed a big scroll Button on top and bottom of the list with all other styles...
    If someone has a hint or way to get rid of them or set the width of the list without using view() ....
    Last edited by ucomesdag; 31st July 2007 at 23:30.

  3. #3
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: QCombobox remove checkbox

    Could you post an example reproducing the problem?
    Or at least a portion of your code? For example, where do you create and initialize the combo box.

    AFAIK, Jpn did something like this( a custom combo with checkable items ), just because it did not existed by default.

    So, I say it again, it is pretty weird.
    Check this out: http://jpnurmi.kapsi.fi/blog/2007/07...-2007/#respond

    Regards

  4. #4
    ucomesdag Guest

    Default Re: QCombobox remove checkbox

    Quote Originally Posted by marcel View Post
    Could you post an example reproducing the problem?
    Or at least a portion of your code? For example, where do you create and initialize the combo box.

    AFAIK, Jpn did something like this( a custom combo with checkable items ), just because it did not existed by default.

    So, I say it again, it is pretty weird.
    Check this out: http://jpnurmi.kapsi.fi/blog/2007/07...-2007/#respond

    Regards
    The original code:
    Qt Code:
    1. QComboBox comboBox = new QComboBox(this);
    2. comboBox ->setGeometry(geometry);
    3. comboBox ->setEditable(false);
    4. comboBox ->setFrame(false);
    5. comboBox ->setMaxVisibleItems(itemsCount);
    6. comboBox ->view()->setMinimumWidth(width);
    To copy to clipboard, switch view to plain text mode 
    This fixed the check box thing but has some weird scroll issues:
    Qt Code:
    1. QListView *view = new QListView;
    2. view->setAutoScroll(false);
    3. view->setMinimumWidth(width);
    4.  
    5. QComboBox comboBox = new QComboBox(this);
    6. comboBox ->setGeometry(geometry);
    7. comboBox ->setEditable(false);
    8. comboBox ->setFrame(false);
    9. comboBox ->setMaxVisibleItems(itemsCount);
    10. comboBox ->setView(view);
    To copy to clipboard, switch view to plain text mode 
    Btw. The parent widget has setStyle(QStyleFactory::create("plastique"));
    Attached Images Attached Images
    Last edited by ucomesdag; 1st August 2007 at 02:03.

Similar Threads

  1. QSettings again ... how to remove array elements
    By Mike in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 09:58

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
  •  
Qt is a trademark of The Qt Company.