#include <QAbstractButton>
#include <QApplication>
-#include <QColorGroup>
#include <QComboBox>
#include <QFontMetrics>
#include <QGroupBox>
: QWidget(parent)
{
delay_search_ = new QTimer(this);
+ search_ = new FancyLineEdit(this);
list_ = new QTreeWidget(this);
stack_ = new QStackedWidget(this);
- search_ = new FancyLineEdit(this);
// Configure the timer
delay_search_->setSingleShot(true);
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());
search_->setPlaceholderText(qt_("Search"));
#endif
- search_->setButtonPixmap(FancyLineEdit::Right, getPixmap("images/", "editclear", "png"));
+#if QT_VERSION >= 0x040600
+ 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);
+#endif
connect(search_, SIGNAL(rightButtonClicked()), this, SLOT(resetSearch()));
connect(search_, SIGNAL(textEdited(QString)), this, SLOT(filterChanged(QString)));
// Create the output layout, horizontal plus a VBox on the left with the search
// box and the tree
- QVBoxLayout * left_layout = new QVBoxLayout();
+ QVBoxLayout * left_layout = new QVBoxLayout;
left_layout->addWidget(search_, 0);
left_layout->addWidget(list_, 1);
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);
}