1 /***************************************************************************
2 * Copyright (C) 2005-2018 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
21 #include "bufferview.h"
23 #include <QApplication>
26 #include <QHeaderView>
29 #include <QMessageBox>
31 #include <QVBoxLayout>
34 #include "buffermodel.h"
35 #include "bufferviewfilter.h"
36 #include "buffersettings.h"
37 #include "buffersyncer.h"
39 #include "contextmenuactionprovider.h"
40 #include "graphicalui.h"
42 #include "networkmodel.h"
43 #include "contextmenuactionprovider.h"
45 /*****************************************
46 * The TreeView showing the Buffers
47 *****************************************/
48 // Please be carefull when reimplementing methods which are used to inform the view about changes to the data
49 // to be on the safe side: call QTreeView's method aswell (or TreeViewTouch's)
50 BufferView::BufferView(QWidget *parent)
51 : TreeViewTouch(parent)
53 connect(this, SIGNAL(collapsed(const QModelIndex &)), SLOT(storeExpandedState(const QModelIndex &)));
54 connect(this, SIGNAL(expanded(const QModelIndex &)), SLOT(storeExpandedState(const QModelIndex &)));
56 setSelectionMode(QAbstractItemView::ExtendedSelection);
58 QAbstractItemDelegate *oldDelegate = itemDelegate();
59 BufferViewDelegate *tristateDelegate = new BufferViewDelegate(this);
60 setItemDelegate(tristateDelegate);
65 void BufferView::init()
67 header()->setContextMenuPolicy(Qt::ActionsContextMenu);
72 // New entries will be expanded automatically when added; no need to call expandAll()
74 header()->hide(); // nobody seems to use this anyway
76 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
79 if (QString("4.8.0") > qVersion()) // FIXME breaks with Qt versions >= 4.10!
82 // FIXME This is to workaround bug #663
83 setUniformRowHeights(true);
85 #ifndef QT_NO_DRAGANDDROP
88 setDropIndicatorShown(true);
91 setSortingEnabled(true);
92 sortByColumn(0, Qt::AscendingOrder);
94 #if defined Q_OS_MACOS || defined Q_OS_WIN
95 // afaik this is better on Mac and Windows
96 disconnect(this, SIGNAL(activated(QModelIndex)), this, SLOT(joinChannel(QModelIndex)));
97 connect(this, SIGNAL(activated(QModelIndex)), SLOT(joinChannel(QModelIndex)));
99 disconnect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(joinChannel(QModelIndex)));
100 connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(joinChannel(QModelIndex)));
105 void BufferView::setModel(QAbstractItemModel *model)
107 delete selectionModel();
109 TreeViewTouch::setModel(model);
111 // remove old Actions
112 QList<QAction *> oldactions = header()->actions();
113 foreach(QAction *action, oldactions) {
114 header()->removeAction(action);
115 action->deleteLater();
122 QAction *showSection;
123 for (int i = 1; i < model->columnCount(); i++) {
124 sectionName = (model->headerData(i, Qt::Horizontal, Qt::DisplayRole)).toString();
125 showSection = new QAction(sectionName, header());
126 showSection->setCheckable(true);
127 showSection->setChecked(!isColumnHidden(i));
128 showSection->setProperty("column", i);
129 connect(showSection, SIGNAL(toggled(bool)), this, SLOT(toggleHeader(bool)));
130 header()->addAction(showSection);
133 connect(model, SIGNAL(layoutChanged()), this, SLOT(on_layoutChanged()));
135 // Make sure collapsation is correct after setting a model
136 // This might not be needed here, only in BufferView::setFilteredModel(). If issues arise, just
137 // move down to setFilteredModel (which calls this function).
142 void BufferView::setFilteredModel(QAbstractItemModel *model_, BufferViewConfig *config)
144 BufferViewFilter *filter = qobject_cast<BufferViewFilter *>(model());
146 filter->setConfig(config);
152 disconnect(this, 0, model(), 0);
153 disconnect(model(), 0, this, 0);
160 BufferViewFilter *filter = new BufferViewFilter(model_, config);
162 connect(filter, SIGNAL(configChanged()), this, SLOT(on_configChanged()));
168 void BufferView::setConfig(BufferViewConfig *config)
170 if (_config == config)
174 disconnect(_config, 0, this, 0);
179 connect(config, SIGNAL(networkIdSet(const NetworkId &)), this, SLOT(setRootIndexForNetworkId(const NetworkId &)));
180 setRootIndexForNetworkId(config->networkId());
184 setRootIndex(QModelIndex());
189 void BufferView::setRootIndexForNetworkId(const NetworkId &networkId)
191 if (!networkId.isValid() || !model()) {
193 setRootIndex(QModelIndex());
197 int networkCount = model()->rowCount();
199 for (int i = 0; i < networkCount; i++) {
200 child = model()->index(i, 0);
201 if (networkId == model()->data(child, NetworkModel::NetworkIdRole).value<NetworkId>())
208 void BufferView::joinChannel(const QModelIndex &index)
210 BufferInfo::Type bufferType = (BufferInfo::Type)index.data(NetworkModel::BufferTypeRole).value<int>();
212 if (bufferType != BufferInfo::ChannelBuffer)
215 BufferInfo bufferInfo = index.data(NetworkModel::BufferInfoRole).value<BufferInfo>();
217 Client::userInput(bufferInfo, QString("/JOIN %1").arg(bufferInfo.bufferName()));
221 void BufferView::dropEvent(QDropEvent *event)
223 QModelIndex index = indexAt(event->pos());
225 QRect indexRect = visualRect(index);
226 QPoint cursorPos = event->pos();
228 // check if we're really _on_ the item and not indicating a move to just above or below the item
229 // Magic margin number for this is from QAbstractItemViewPrivate::position()
230 const int margin = 2;
231 if (cursorPos.y() - indexRect.top() < margin
232 || indexRect.bottom() - cursorPos.y() < margin)
233 return TreeViewTouch::dropEvent(event);
235 // If more than one buffer was being dragged, treat this as a rearrangement instead of a merge request
236 QList<QPair<NetworkId, BufferId> > bufferList = Client::networkModel()->mimeDataToBufferList(event->mimeData());
237 if (bufferList.count() != 1)
238 return TreeViewTouch::dropEvent(event);
240 // Get the Buffer ID of the buffer that was being dragged
241 BufferId bufferId2 = bufferList[0].second;
243 // Get the Buffer ID of the target buffer
244 BufferId bufferId1 = index.data(NetworkModel::BufferIdRole).value<BufferId>();
246 // If the source and target are the same buffer, this was an aborted rearrangement
247 if (bufferId1 == bufferId2)
248 return TreeViewTouch::dropEvent(event);
250 // Get index of buffer that was being dragged
251 QModelIndex index2 = Client::networkModel()->bufferIndex(bufferId2);
253 // If the buffer being dragged is a channel and we're still joined to it, treat this as a rearrangement
254 // This prevents us from being joined to a channel with no associated UI elements
255 if (index2.data(NetworkModel::BufferTypeRole) == BufferInfo::ChannelBuffer && index2.data(NetworkModel::ItemActiveRole) == true)
256 return TreeViewTouch::dropEvent(event);
258 //If the source buffer is not mergeable(AKA not a Channel and not a Query), try rearranging instead
259 if (index2.data(NetworkModel::BufferTypeRole) != BufferInfo::ChannelBuffer && index2.data(NetworkModel::BufferTypeRole) != BufferInfo::QueryBuffer)
260 return TreeViewTouch::dropEvent(event);
262 // If the target buffer is not mergeable(AKA not a Channel and not a Query), try rearranging instead
263 if (index.data(NetworkModel::BufferTypeRole) != BufferInfo::ChannelBuffer && index.data(NetworkModel::BufferTypeRole) != BufferInfo::QueryBuffer)
264 return TreeViewTouch::dropEvent(event);
266 // Confirm that the user really wants to merge the buffers before doing so
267 int res = QMessageBox::question(0, tr("Merge buffers permanently?"),
268 tr("Do you want to merge the buffer \"%1\" permanently into buffer \"%2\"?\n This cannot be reversed!").arg(Client::networkModel()->bufferName(bufferId2)).arg(Client::networkModel()->bufferName(bufferId1)),
269 QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
270 if (res == QMessageBox::Yes) {
271 Client::mergeBuffersPermanently(bufferId1, bufferId2);
276 void BufferView::removeSelectedBuffers(bool permanently)
282 QSet<BufferId> removedRows;
283 foreach(QModelIndex index, selectionModel()->selectedIndexes()) {
284 if (index.data(NetworkModel::ItemTypeRole) != NetworkModel::BufferItemType)
287 bufferId = index.data(NetworkModel::BufferIdRole).value<BufferId>();
288 if (removedRows.contains(bufferId))
291 removedRows << bufferId;
294 foreach(BufferId bufferId, removedRows) {
296 config()->requestRemoveBufferPermanently(bufferId);
298 config()->requestRemoveBuffer(bufferId);
303 void BufferView::rowsInserted(const QModelIndex &parent, int start, int end)
305 TreeViewTouch::rowsInserted(parent, start, end);
307 // ensure that newly inserted network nodes are expanded per default
308 if (parent.data(NetworkModel::ItemTypeRole) != NetworkModel::NetworkItemType)
311 setExpandedState(parent);
315 void BufferView::on_layoutChanged()
317 int numNets = model()->rowCount(QModelIndex());
318 for (int row = 0; row < numNets; row++) {
319 QModelIndex networkIdx = model()->index(row, 0, QModelIndex());
320 setExpandedState(networkIdx);
325 void BufferView::on_configChanged()
329 // Expand/collapse as needed
333 // update selection to current one
334 Client::bufferModel()->synchronizeView(this);
339 void BufferView::setExpandedState()
341 // Expand all active networks, collapse inactive ones... unless manually changed
342 QModelIndex networkIdx;
344 for (int row = 0; row < model()->rowCount(); row++) {
345 networkIdx = model()->index(row, 0);
346 if (model()->rowCount(networkIdx) == 0)
349 networkId = model()->data(networkIdx, NetworkModel::NetworkIdRole).value<NetworkId>();
350 if (!networkId.isValid())
353 setExpandedState(networkIdx);
358 void BufferView::storeExpandedState(const QModelIndex &networkIdx)
360 NetworkId networkId = model()->data(networkIdx, NetworkModel::NetworkIdRole).value<NetworkId>();
363 if (isExpanded(networkIdx))
364 oldState |= WasExpanded;
365 if (model()->data(networkIdx, NetworkModel::ItemActiveRole).toBool())
366 oldState |= WasActive;
368 _expandedState[networkId] = oldState;
372 void BufferView::setExpandedState(const QModelIndex &networkIdx)
374 if (model()->data(networkIdx, NetworkModel::ItemTypeRole) != NetworkModel::NetworkItemType)
377 if (model()->rowCount(networkIdx) == 0)
380 NetworkId networkId = model()->data(networkIdx, NetworkModel::NetworkIdRole).value<NetworkId>();
382 bool networkActive = model()->data(networkIdx, NetworkModel::ItemActiveRole).toBool();
383 bool expandNetwork = networkActive;
384 if (_expandedState.contains(networkId)) {
385 int oldState = _expandedState[networkId];
386 if ((bool)(oldState & WasActive) == networkActive)
387 expandNetwork = (bool)(oldState & WasExpanded);
390 if (expandNetwork != isExpanded(networkIdx)) {
392 setExpanded(networkIdx, expandNetwork);
394 storeExpandedState(networkIdx); // this call is needed to keep track of the isActive state
397 #if QT_VERSION < 0x050000
398 void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
400 TreeViewTouch::dataChanged(topLeft, bottomRight);
402 void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
404 TreeViewTouch::dataChanged(topLeft, bottomRight, roles);
407 // determine how many items have been changed and if any of them is a networkitem
408 // which just swichted from active to inactive or vice versa
409 if (topLeft.data(NetworkModel::ItemTypeRole) != NetworkModel::NetworkItemType)
412 for (int i = topLeft.row(); i <= bottomRight.row(); i++) {
413 QModelIndex networkIdx = topLeft.sibling(i, 0);
414 setExpandedState(networkIdx);
419 void BufferView::toggleHeader(bool checked)
421 QAction *action = qobject_cast<QAction *>(sender());
422 header()->setSectionHidden((action->property("column")).toInt(), !checked);
426 void BufferView::contextMenuEvent(QContextMenuEvent *event)
428 QModelIndex index = indexAt(event->pos());
429 if (!index.isValid())
432 QMenu contextMenu(this);
434 if (index.isValid()) {
435 addActionsToMenu(&contextMenu, index);
438 addFilterActions(&contextMenu, index);
440 if (!contextMenu.actions().isEmpty())
441 contextMenu.exec(QCursor::pos());
445 void BufferView::addActionsToMenu(QMenu *contextMenu, const QModelIndex &index)
447 QModelIndexList indexList = selectedIndexes();
448 // make sure the item we clicked on is first
449 indexList.removeAll(index);
450 indexList.prepend(index);
452 GraphicalUi::contextMenuActionProvider()->addActions(contextMenu, indexList, this, "menuActionTriggered", (bool)config());
456 void BufferView::addFilterActions(QMenu *contextMenu, const QModelIndex &index)
458 BufferViewFilter *filter = qobject_cast<BufferViewFilter *>(model());
460 QList<QAction *> filterActions = filter->actions(index);
461 if (!filterActions.isEmpty()) {
462 contextMenu->addSeparator();
463 foreach(QAction *action, filterActions) {
464 contextMenu->addAction(action);
471 void BufferView::menuActionTriggered(QAction *result)
473 ContextMenuActionProvider::ActionType type = (ContextMenuActionProvider::ActionType)result->data().toInt();
475 case ContextMenuActionProvider::HideBufferTemporarily:
476 removeSelectedBuffers();
478 case ContextMenuActionProvider::HideBufferPermanently:
479 removeSelectedBuffers(true);
487 void BufferView::nextBuffer()
489 changeBuffer(Forward);
493 void BufferView::previousBuffer()
495 changeBuffer(Backward);
499 void BufferView::changeBuffer(Direction direction)
501 QModelIndex currentIndex = selectionModel()->currentIndex();
502 QModelIndex resultingIndex;
504 QModelIndex lastNetIndex = model()->index(model()->rowCount() - 1, 0, QModelIndex());
506 if (currentIndex.parent().isValid()) {
507 //If we are a child node just switch among siblings unless it's the first/last child
508 resultingIndex = currentIndex.sibling(currentIndex.row() + direction, 0);
510 if (!resultingIndex.isValid()) {
511 QModelIndex parent = currentIndex.parent();
512 if (direction == Backward)
513 resultingIndex = parent;
515 resultingIndex = parent.sibling(parent.row() + direction, 0);
519 //If we have a toplevel node, try and get an adjacent child
520 if (direction == Backward) {
521 QModelIndex newParent = currentIndex.sibling(currentIndex.row() - 1, 0);
522 if (currentIndex.row() == 0)
523 newParent = lastNetIndex;
524 if (model()->hasChildren(newParent))
525 resultingIndex = newParent.child(model()->rowCount(newParent) - 1, 0);
527 resultingIndex = newParent;
530 if (model()->hasChildren(currentIndex))
531 resultingIndex = currentIndex.child(0, 0);
533 resultingIndex = currentIndex.sibling(currentIndex.row() + 1, 0);
537 if (!resultingIndex.isValid()) {
538 if (direction == Forward)
539 resultingIndex = model()->index(0, 0, QModelIndex());
541 resultingIndex = lastNetIndex.child(model()->rowCount(lastNetIndex) - 1, 0);
544 selectionModel()->setCurrentIndex(resultingIndex, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
545 selectionModel()->select(resultingIndex, QItemSelectionModel::ClearAndSelect);
548 void BufferView::selectFirstBuffer()
550 int networksCount = model()->rowCount(QModelIndex());
551 if (networksCount == 0) {
555 QModelIndex bufferIndex;
556 for (int row = 0; row < networksCount; row++) {
557 QModelIndex networkIndex = model()->index(row, 0, QModelIndex());
558 int childCount = model()->rowCount(networkIndex);
559 if (childCount > 0) {
560 bufferIndex = model()->index(0, 0, networkIndex);
565 if (!bufferIndex.isValid()) {
569 selectionModel()->setCurrentIndex(bufferIndex, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
570 selectionModel()->select(bufferIndex, QItemSelectionModel::ClearAndSelect);
573 void BufferView::wheelEvent(QWheelEvent *event)
575 if (ItemViewSettings().mouseWheelChangesBuffer() == (bool)(event->modifiers() & Qt::AltModifier))
576 return TreeViewTouch::wheelEvent(event);
578 int rowDelta = (event->delta() > 0) ? -1 : 1;
579 changeBuffer((Direction)rowDelta);
583 void BufferView::hideCurrentBuffer()
585 QModelIndex index = selectionModel()->currentIndex();
586 if (index.data(NetworkModel::ItemTypeRole) != NetworkModel::BufferItemType)
589 BufferId bufferId = index.data(NetworkModel::BufferIdRole).value<BufferId>();
591 //The check above means we won't be looking at a network, which should always be the first row, so we can just go backwards.
592 changeBuffer(Backward);
594 config()->requestRemoveBuffer(bufferId);
597 void BufferView::filterTextChanged(QString filterString)
599 BufferViewFilter *filter = qobject_cast<BufferViewFilter *>(model());
603 filter->setFilterString(filterString);
604 on_configChanged(); // make sure collapsation is correct
608 QSize BufferView::sizeHint() const
610 return TreeViewTouch::sizeHint();
613 return TreeViewTouch::sizeHint();
615 if (model()->rowCount() == 0)
616 return QSize(120, 50);
619 for (int i = 0; i < model()->columnCount(); i++) {
620 if (!isColumnHidden(i))
621 columnSize += sizeHintForColumn(i);
623 return QSize(columnSize, 50);
627 // ****************************************
629 // ****************************************
630 class ColorsChangedEvent : public QEvent
633 ColorsChangedEvent() : QEvent(QEvent::User) {};
637 BufferViewDelegate::BufferViewDelegate(QObject *parent)
638 : QStyledItemDelegate(parent)
643 void BufferViewDelegate::customEvent(QEvent *event)
645 if (event->type() != QEvent::User)
652 bool BufferViewDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
654 if (event->type() != QEvent::MouseButtonRelease)
655 return QStyledItemDelegate::editorEvent(event, model, option, index);
657 if (!(model->flags(index) & Qt::ItemIsUserCheckable))
658 return QStyledItemDelegate::editorEvent(event, model, option, index);
660 QVariant value = index.data(Qt::CheckStateRole);
661 if (!value.isValid())
662 return QStyledItemDelegate::editorEvent(event, model, option, index);
664 #if QT_VERSION < 0x050000
665 QStyleOptionViewItemV4 viewOpt(option);
667 QStyleOptionViewItem viewOpt(option);
669 initStyleOption(&viewOpt, index);
671 QRect checkRect = viewOpt.widget->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &viewOpt, viewOpt.widget);
672 QMouseEvent *me = static_cast<QMouseEvent *>(event);
674 if (me->button() != Qt::LeftButton || !checkRect.contains(me->pos()))
675 return QStyledItemDelegate::editorEvent(event, model, option, index);
677 Qt::CheckState state = static_cast<Qt::CheckState>(value.toInt());
678 if (state == Qt::Unchecked)
679 state = Qt::PartiallyChecked;
680 else if (state == Qt::PartiallyChecked)
683 state = Qt::Unchecked;
684 model->setData(index, state, Qt::CheckStateRole);
689 // ==============================
691 // ==============================
692 BufferViewDock::BufferViewDock(BufferViewConfig *config, QWidget *parent)
693 : QDockWidget(parent),
695 _widget(new QWidget(parent)),
696 _filterEdit(new QLineEdit(parent)),
698 _title(config->bufferViewName())
700 setObjectName("BufferViewDock-" + QString::number(config->bufferViewId()));
701 toggleViewAction()->setData(config->bufferViewId());
702 setAllowedAreas(Qt::RightDockWidgetArea|Qt::LeftDockWidgetArea);
703 connect(config, SIGNAL(bufferViewNameSet(const QString &)), this, SLOT(bufferViewRenamed(const QString &)));
704 connect(config, SIGNAL(configChanged()), SLOT(configChanged()));
707 _widget->setLayout(new QVBoxLayout);
708 _widget->layout()->setSpacing(0);
709 _widget->layout()->setContentsMargins(0, 0, 0, 0);
711 // We need to potentially hide it early, so it doesn't flicker
712 _filterEdit->setVisible(config->showSearch());
713 _filterEdit->setFocusPolicy(Qt::ClickFocus);
714 _filterEdit->installEventFilter(this);
715 _filterEdit->setPlaceholderText(tr("Search..."));
716 connect(_filterEdit, SIGNAL(returnPressed()), SLOT(onFilterReturnPressed()));
718 _widget->layout()->addWidget(_filterEdit);
719 QDockWidget::setWidget(_widget);
722 void BufferViewDock::setLocked(bool locked) {
727 setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
731 void BufferViewDock::updateTitle()
733 QString title = _title;
735 title.prepend(QString::fromUtf8("• "));
736 setWindowTitle(title);
739 void BufferViewDock::configChanged()
741 if (_filterEdit->isVisible() != config()->showSearch()) {
742 _filterEdit->setVisible(config()->showSearch());
743 _filterEdit->clear();
747 void BufferViewDock::onFilterReturnPressed()
750 _oldFocusItem->setFocus();
754 if (!config()->showSearch()) {
755 _filterEdit->setVisible(false);
758 BufferView *view = bufferView();
759 if (!view || _filterEdit->text().isEmpty()) {
763 view->selectFirstBuffer();
764 _filterEdit->clear();
767 void BufferViewDock::setActive(bool active)
769 if (active != isActive()) {
773 raise(); // for tabbed docks
778 bool BufferViewDock::eventFilter(QObject *object, QEvent *event)
780 if (object != _filterEdit) {
784 if (event->type() == QEvent::FocusOut) {
785 if (!config()->showSearch() && _filterEdit->text().isEmpty()) {
786 _filterEdit->setVisible(false);
789 } else if (event->type() == QEvent::KeyRelease) {
790 QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
791 if (keyEvent->key() != Qt::Key_Escape) {
795 _filterEdit->clear();
798 _oldFocusItem->setFocus();
808 void BufferViewDock::bufferViewRenamed(const QString &newName)
812 toggleViewAction()->setText(newName);
816 int BufferViewDock::bufferViewId() const
818 BufferView *view = bufferView();
823 return view->config()->bufferViewId();
829 BufferViewConfig *BufferViewDock::config() const
831 BufferView *view = bufferView();
835 return view->config();
838 void BufferViewDock::setWidget(QWidget *newWidget)
840 _widget->layout()->addWidget(newWidget);
841 _childWidget = newWidget;
843 connect(_filterEdit, SIGNAL(textChanged(QString)), bufferView(), SLOT(filterTextChanged(QString)));
846 void BufferViewDock::activateFilter()
848 if (!_filterEdit->isVisible()) {
849 _filterEdit->setVisible(true);
852 _oldFocusItem = qApp->focusWidget();
854 _filterEdit->setFocus();