#include "LyX.h"
#include "LyXRC.h"
#include "Paragraph.h"
+#include "qt_helpers.h"
#include "version.h"
#include "support/lassert.h"
~GuiCompletionModel() { delete list_; }
///
void setList(CompletionList const * l) {
+ beginResetModel();
delete list_;
list_ = l;
- reset();
+ endResetModel();
}
///
bool sorted() const
// get icon from cache
QPixmap scaled;
QString const name = ":" + toqstr(list_->icon(index.row()));
+ if (name == ":")
+ return scaled;
if (!QPixmapCache::find("completion" + name, scaled)) {
// load icon from disk
QPixmap p = QPixmap(name);
// has a bad memory about it and we have to tell him again and again.
QTreeView * listView = static_cast<QTreeView *>(popup());
listView->header()->setStretchLastSection(false);
- listView->header()->setResizeMode(0, QHeaderView::Stretch);
- listView->header()->setResizeMode(1, QHeaderView::Fixed);
+ setSectionResizeMode(listView->header(), 0, QHeaderView::Stretch);
+ setSectionResizeMode(listView->header(), 1, QHeaderView::Fixed);
listView->header()->resizeSection(1, 22);
// show/update popup
i = n;
else
i = l;
- LASSERT(i <= n, /**/);
+ // we can try to recover
+ LASSERT(i <= n, i = 0);
}
// select the first if none was found