]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToolbar.cpp
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / GuiToolbar.cpp
index e0b9e6ce3a8fb611aa4e3d740412b443fb786e1d..ed6277df583dca60083a741d130b6381a8bde518 100644 (file)
@@ -360,7 +360,7 @@ class GuiFilterProxyModel : public QSortFilterProxyModel
 public:
        ///
        GuiFilterProxyModel(QObject * parent)
-       : QSortFilterProxyModel(parent) {}
+               : QSortFilterProxyModel(parent) {}
 
        ///
        void setCharFilter(QString const & f)
@@ -431,7 +431,7 @@ void GuiLayoutBox::setFilter(QString const & s)
        // FIXME: There must be a better way. The QComboBox::AdjustToContents)
        //        does not help.
        if (view()->isVisible())
-               showPopup();
+               QComboBox::showPopup();
 }
 
 
@@ -441,6 +441,14 @@ void GuiLayoutBox::resetFilter()
 }
 
 
+void GuiLayoutBox::showPopup()
+{
+       resetFilter();
+       owner_.message(_("Enter characters to filter the layout list."));
+       QComboBox::showPopup();
+}
+
+
 bool GuiLayoutBox::eventFilter(QObject * o, QEvent * e)
 {
        if (e->type() != QEvent::KeyPress)
@@ -539,7 +547,7 @@ void GuiLayoutBox::addItemSort(docstring const & item, bool sorted)
                QString is = model_->item(i, 0)->text();
                while (is.compare(titem) < 0) {
                        // e.g. --Separator--
-                       if (is[0].category() != QChar::Letter_Uppercase)
+                       if (is.at(0).category() != QChar::Letter_Uppercase)
                                break;
                        ++i;
                        if (i == end)