Results 1 to 4 of 4

Thread: incorrected QComboBox capture screen.

  1. #1
    Join Date
    Feb 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default incorrected QComboBox capture screen.

    attached file : QComboBox capture.

    apply code
    Qt Code:
    1. // ICAO CD
    2. cboIcao_cd->clear();
    3. cboIcao_cd->setModel(ComboDataCollection::getInstance().getTableModel(icao_cdModel, "TB_CNTRYCD", QStringList() << "ICAO_CD"));
    4. cboIcao_cd->setModelColumn(0);
    5.  
    6. // Combo box Height
    7. cboIcao_cd->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    8. QCompleter *p = new QCompleter(icao_cdModel);
    9. p->setCompletionMode(QCompleter::PopupCompletion);
    10. p->setMaxVisibleItems(20);
    11. cboIcao_cd->setCompleter(p);
    12. cboIcao_cd->show();
    To copy to clipboard, switch view to plain text mode 

    The code execute, then QComboBox size is overflowed , like attached file.

    What is incorrect it?

    If someone has a simple example I'd greatly appreciate it.
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: incorrected QComboBox capture screen.

    You've set the max visible items on the completer popup, try setting setMaxVisibleItems(?) on your combobox.

  3. #3
    Join Date
    Feb 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: incorrected QComboBox capture screen.

    I tried setting setMaxVisibleItems on my combobox, also QComboBox size is overflowed.

  4. #4
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: incorrected QComboBox capture screen.

    Using the code from your other thread the following worked:
    Qt Code:
    1. comboBox->setMaxVisibleItems(5);
    2. QCompleter *p = new QCompleter(queryModel);
    3. p->setMaxVisibleItems(3);
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

Similar Threads

  1. Touch screen signature capture using QPainter
    By Askar in forum Qt Programming
    Replies: 1
    Last Post: 18th February 2010, 06:55
  2. Replies: 3
    Last Post: 5th July 2009, 18:22
  3. Capture OpenGL screen pixels
    By Windsoarer in forum Qt Programming
    Replies: 3
    Last Post: 5th May 2009, 05:24
  4. capture screen (with Mouse) ?
    By ascii in forum Qt Programming
    Replies: 3
    Last Post: 12th November 2008, 13:16
  5. Application Id Capture
    By PRIYANOB in forum Qt Programming
    Replies: 1
    Last Post: 11th September 2007, 12:31

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.