Results 1 to 8 of 8

Thread: QCcompleter , colum probelm

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QCcompleter , colum probelm

    I can reproduce this error on my installation. It seems that setCompletionColumn() doesn't set a proper model column on the popup. A solution is to call:
    Qt Code:
    1. ((QListView*)cc->popup())->setModelColumn(2);
    To copy to clipboard, switch view to plain text mode 
    The funny thing is, that it should work without it just fine...

    This is the code that gets called:
    Qt Code:
    1. void QCompleter::setCompletionColumn(int column)
    2. {
    3. Q_D(QCompleter);
    4. if (d->column == column)
    5. return;
    6. #ifndef QT_NO_LISTVIEW
    7. if (QListView *listView = qobject_cast<QListView *>(d->popup))
    8. listView->setModelColumn(column);
    9. #endif
    10. d->column = column;
    11. d->proxy->invalidate();
    12. }
    To copy to clipboard, switch view to plain text mode 
    So there are three explanations:
    1. popup is not a QListView
    2. d->column == column
    3. QT_NO_LISTVIEW is defined

    First two assumptions are false (popup is a list view and d->column != column) and the third seems very unlikely. So there has to be a fourth explanation - something overrides or doesn't allow to change the model column for the listview.

  2. #2
    Join Date
    Jan 2008
    Posts
    9
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCcompleter , colum probelm

    well thanks alot .
    it now works , the colum i want appear , but something starnge is happening..
    when the list popup , it don't handle keyboard evens well..
    for example when i write the first letter , and the list is poped up , i try to move by the keyboard down , it just moves to one item then refuse to go down anymore..
    the same happens when i try to go upwards , the pagedown and pageup don't work at all ?

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.