]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/PanelStack.cpp
Merge branch 'biblatex2' of git.lyx.org:features into biblatex2
[lyx.git] / src / frontends / qt4 / PanelStack.cpp
index 47662a66c7cdb699b59b4b2340ba8f4bdba4b559..70ab4e0776395b98f7c4b1c416e249a7e1cc7b71 100644 (file)
@@ -16,7 +16,6 @@
 #include "qt_helpers.h"
 
 #include "support/debug.h"
-#include "support/foreach.h"
 #include "support/lassert.h"
 
 #include <QAbstractButton>
@@ -60,7 +59,7 @@ PanelStack::PanelStack(QWidget * parent)
        list_->setRootIsDecorated(false);
        list_->setColumnCount(1);
        list_->header()->hide();
-       list_->header()->setResizeMode(QHeaderView::ResizeToContents);
+       setSectionResizeMode(list_->header(), QHeaderView::ResizeToContents);
        list_->header()->setStretchLastSection(false);
        list_->setMinimumSize(list_->viewport()->size());
 
@@ -75,7 +74,7 @@ PanelStack::PanelStack(QWidget * parent)
 #endif
 
 #if QT_VERSION >= 0x040600
-       search_->setButtonPixmap(FancyLineEdit::Right, getPixmap("images/", "editclear", "png"));
+       search_->setButtonPixmap(FancyLineEdit::Right, getPixmap("images/", "editclear", "svgz,png"));
        search_->setButtonVisible(FancyLineEdit::Right, true);
        search_->setButtonToolTip(FancyLineEdit::Right, qt_("Clear text"));
        search_->setAutoHideButton(FancyLineEdit::Right, true);
@@ -105,13 +104,13 @@ void PanelStack::addCategory(QString const & name, QString const & parent)
 
        if (parent.isEmpty()) {
                item = new QTreeWidgetItem(list_);
-               item->setText(0, name);
+               item->setText(0, qt_(name));
        }
        else {
                if (!panel_map_.contains(parent))
                        addCategory(parent);
                item = new QTreeWidgetItem(panel_map_.value(parent));
-               item->setText(0, name);
+               item->setText(0, qt_(name));
                depth = 2;
                list_->setRootIsDecorated(true);
        }
@@ -244,11 +243,11 @@ void PanelStack::search()
        // If the search string is empty we enable all the items
        // otherwise we disable everything and then selectively
        // re-enable matching items
-       foreach (QTreeWidgetItem * tree_item, panel_map_) {
+       for (QTreeWidgetItem * tree_item : panel_map_) {
                setTreeItemStatus(tree_item, enable_all);
        }
 
-       foreach (QTreeWidgetItem * tree_item, panel_map_) {
+       for (QTreeWidgetItem * tree_item : panel_map_) {
                // Current widget
                QWidget * pane_widget = widget_map_[tree_item];
 
@@ -259,7 +258,7 @@ void PanelStack::search()
                if (pane_widget) {
                        // Loops on the list of children widgets (recursive)
                        QWidgetList children = pane_widget->findChildren<QWidget *>();
-                       foreach (QWidget * child_widget, children) {
+                       for (QWidget * child_widget : children) {
                                bool widget_matches = false;
 
                                // Try to cast to the most common widgets and looks in it's content