Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
SOHViewer
Commits
59d9cc4c
Commit
59d9cc4c
authored
1 year ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
Get clear search button from search line edit
parent
f8be3926
No related branches found
No related tags found
1 merge request
!94
Implement file search
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/view/ui/main_ui.py
+14
-0
14 additions, 0 deletions
sohstationviewer/view/ui/main_ui.py
with
14 additions
and
0 deletions
sohstationviewer/view/ui/main_ui.py
+
14
−
0
View file @
59d9cc4c
...
...
@@ -399,6 +399,20 @@ class UIMainWindow(object):
self
.
search_line_edit
.
setToolTip
(
'
Filter the list of files based on
'
'
the content.
'
)
self
.
search_line_edit
.
setClearButtonEnabled
(
True
)
try
:
# This value was obtained from the C++ source of QT. We use it here
# so that the QAction found is guaranteed to be the clear button.
clear_action_name
=
'
_q_qlineeditclearaction
'
found_actions
=
self
.
search_line_edit
.
findChildren
(
QAction
,
clear_action_name
)
self
.
clear_search_action
=
found_actions
[
0
]
except
IndexError
:
# If the name of the clear button is changed in the C++ source of
# QT, nothing will be found. So, we raise
raise
ValueError
(
'
No clear button could be found. Check its
'
'
objectName attribute using QObject.findChildren
'
'
without a name.
'
)
search_layout
.
addWidget
(
self
.
search_line_edit
)
search_layout
.
addSpacing
(
2
)
self
.
search_button
=
QPushButton
(
'
Search
'
,
self
.
central_widget
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment