Hi,
im inserting some items like this:
Code:
for(unsigned i=0; i<list.count();i++){ if(list[i]=="." || list[i]=="..") continue; ui.software_cb->insertItem(-1, list[i]);}
How could i sort my combobox?
:crying:
Printable View
Hi,
im inserting some items like this:
Code:
for(unsigned i=0; i<list.count();i++){ if(list[i]=="." || list[i]=="..") continue; ui.software_cb->insertItem(-1, list[i]);}
How could i sort my combobox?
:crying:
See QComboBox::InsertPolicy.
Edit: Oh, and there is also a filter called QDir::NoDotAndDotDot to skip those entries in the entry list...
Hi,
i tried all InsertPolicy options showing in the designer (for example insert Alphabeticaly ...), but i have the false sorting..
w....a and not from a ... to w :crying:
Can somebody help me to sort my combobox :crying:
You know, it's kind of impossible to say what's the problem without seeing any code. Anyway, here's two ways of listing files in an alphabetic order.
1) using QComboBox::InsertAlphabetically:
Code:
#include <QtGui> int main(int argc, char* argv[]) { QComboBox combo; combo.show(); return app.exec(); }
2) using QDir::Name sort flag
Hi JPN,
thank you very much!! It works :)
I only tried to set the option in the designer "insert Alphabeticaly"..
Thank u!!