32 : layout(new QVBoxLayout())
42 Qt::Alignment alignment)
45 layout->insertWidget(closest, widget, stretch, alignment);
55 if (index >=
layout->count())
59 qobject_cast<GenericChatItemWidget*>(
layout->itemAt(index)->widget());
60 assert(atMid !=
nullptr);
80 if (
layout->itemAt(index) ==
nullptr)
84 qobject_cast<GenericChatItemWidget*>(
layout->itemAt(index)->widget());
85 assert(atMid !=
nullptr);
88 layout->removeWidget(widget);
93 for (
int index = 0; index <
layout->count(); ++index) {
95 qobject_cast<GenericChatItemWidget*>(
layout->itemAt(index)->widget());
96 assert(widgetAt !=
nullptr);
110 int min = 0, max =
layout->count();
112 int mid = (max - min) / 2 + min;
114 qobject_cast<GenericChatItemWidget*>(
layout->itemAt(mid)->widget());
115 assert(atMid !=
nullptr);
117 bool lessThan =
false;
120 collator.setNumericMode(
true);
122 int compareValue = collator.compare(atMid->
getName(), widget->
getName());
124 if (compareValue < 0)
126 else if (compareValue == 0)
127 lessThan = atMid < widget;