Skip to content

Commit

Permalink
fix: [workspace]input method panel issue
Browse files Browse the repository at this point in the history
disable the input method in fileview class.

Log: fix input method panel issue
Bug: https://pms.uniontech.com/bug-view-207839.html
  • Loading branch information
Lighto-Ku authored and deepin-bot[bot] committed Jul 26, 2023
1 parent 2837851 commit f322013
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,21 @@ void FileView::paintEvent(QPaintEvent *event)
}
}

void FileView::focusInEvent(QFocusEvent *event)
{
DListView::focusInEvent(event);
if (itemDelegate())
itemDelegate()->commitDataAndCloseActiveEditor();

setAttribute(Qt::WA_InputMethodEnabled, false);
}

void FileView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
DListView::currentChanged(current, previous);
setAttribute(Qt::WA_InputMethodEnabled, false);
}

void FileView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
{
QModelIndex currentIdx = currentIndex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ public slots:
bool event(QEvent *e) override;
bool eventFilter(QObject *obj, QEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void focusInEvent(QFocusEvent *event) override;
void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;

void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;

Expand Down

0 comments on commit f322013

Please sign in to comment.