Merge pull request #237 from iaom/0512-dev

Fix: Automatic completion won't work in next search after clicked actions in detial widget.
This commit is contained in:
Mouse Zhang 2021-05-20 08:59:16 +08:00 committed by GitHub
commit 1f81c9bcb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 5 deletions

View File

@ -24,12 +24,13 @@ public:
QIcon icon;
QString name;
QVector<DescriptionInfo> description;
QMap<QString,QString> actionMap;//action name and action key
QStringList actionList; //all actions, take fist for double click action.
QString key;
};
virtual ~SearchPluginIface() {}
virtual QString getPluginName() = 0;
virtual void KeywordSearch(QString keyword,QQueue<ResultInfo> *searchResult) = 0;
virtual void openAction(QString name, QString key) = 0;
virtual void openAction(QString action, QString key) = 0;
};
}

View File

@ -91,6 +91,7 @@ void ContentWidget::initUI() {
clearLayout(m_homePageLyt);
initHomePage();
});
connect(m_detailView, &SearchDetailView::actionTriggerd, this, &ContentWidget::effectiveSearch);
m_resultDetailArea->setWidget(m_detailView);
m_resultDetailArea->setWidgetResizable(true);
m_resultListArea->setFrameShape(QFrame::NoFrame);
@ -283,7 +284,7 @@ void ContentWidget::setupConnect(SearchListView * listview) {
connect(listview, &SearchListView::currentSelectPos, [ = ](QPoint pos) {
m_resultListArea->ensureVisible(pos.x(), pos.y());
});
connect(listview, &SearchListView::mousePressed, this, &ContentWidget::mousePressed);
connect(listview, &SearchListView::mousePressed, this, &ContentWidget::effectiveSearch);
connect(listview, &SearchListView::currentRowChanged, this, &ContentWidget::onListViewRowChanged);
connect(listview, &SearchListView::onRowDoubleClicked, this, &ContentWidget::onListViewRowDoubleClicked);
}

View File

@ -109,7 +109,7 @@ private:
Q_SIGNALS:
void currentItemChanged();
void mousePressed();
void effectiveSearch();
private Q_SLOTS:
void clearLayout(QLayout *);

View File

@ -406,6 +406,7 @@ void SearchDetailView::execActions(const int& type, const int& option, const QSt
default:
break;
}
Q_EMIT this->actionTriggerd();
}
/**

View File

@ -105,6 +105,7 @@ private:
Q_SIGNALS:
void configFileChanged();
void actionTriggerd();
private Q_SLOTS:
void execActions(const int&, const int&, const QString&);
void refreshIcon();

View File

@ -253,7 +253,7 @@ void MainWindow::initUi() {
mainlayout->addWidget(m_titleFrame);
mainlayout->addWidget(m_contentFrame);
mainlayout->addWidget(m_searchWidget);
connect(m_contentFrame, &ContentWidget::mousePressed, m_searchLayout, &SearchBarHLayout::effectiveSearchRecord);
connect(m_contentFrame, &ContentWidget::effectiveSearch, m_searchLayout, &SearchBarHLayout::effectiveSearchRecord);
connect(QApplication::primaryScreen(), &QScreen::geometryChanged,
this, &MainWindow::monitorResolutionChange);