void MyCheckBoxContainer::add(QString item)\r
{\r
QStringList list = item.split("\n");\r
+ QStringList list2;\r
if(sortAlphabetically)\r
{\r
- list.sort();\r
+ list2.append(list.takeFirst());\r
+ int listSize = list.size();\r
+ int pos = 0;\r
+ bool inserted = false;\r
+ for(int i = 0; i < listSize; ++i)\r
+ {\r
+ inserted = false;\r
+ int list2Size = list2.size();\r
+ for(int j = 0; j < list2Size; ++j)\r
+ {\r
+ pos = j;\r
+ if(list[i].toUpper() < list2[j].toUpper())\r
+ {\r
+ list2.insert(pos, list[i]);\r
+ inserted = true;\r
+ break;\r
+ }\r
+ }\r
+ if(inserted == false)\r
+ {\r
+ list2.append(list[i]);\r
+ }\r
+ }\r
+ list = list2;\r
}\r
+ qDebug() << "list" << list;\r
foreach(QString item, list)\r
{\r
if(item.length() > 0)\r
\r
void MyCheckBoxContainer::set(QString item)\r
{\r
- qDebug() << item;\r
clear();\r
add(item);\r
}\r
int pos = 0;\r
for(pos = 0; pos < size; ++pos)\r
{\r
- if(tempListChecked[pos]->text() > item->text())\r
+ if(tempListChecked[pos]->text().toUpper() > item->text().toUpper())\r
{\r
break;\r
}\r
int pos = 0;\r
for(pos = 0; pos < size; ++pos)\r
{\r
- if(tempList[pos]->text() > item->text())\r
+ if(tempList[pos]->text().toUpper() > item->text().toUpper())\r
{\r
break;\r
}\r
checkBoxes.clear();\r
checkBoxes.append(tempList);\r
checkBoxes.append(tempListChecked);\r
- emit signalSorted();\r
}\r
+ emit signalSorted();\r
}\r
\r
QList<MyCheckBox * > const & MyCheckBoxContainer::getCheckBoxes()\r