Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
7915ce6b
Commit
7915ce6b
authored
Jan 14, 2011
by
con
Browse files
Show wrap indicator also for searches in help views.
Task-number: QTCREATORBUG-2753
parent
ebb9e252
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/help/centralwidget.cpp
View file @
7915ce6b
...
...
@@ -167,9 +167,9 @@ void CentralWidget::setCurrentPage(HelpViewer *page)
}
bool
CentralWidget
::
find
(
const
QString
&
txt
,
Find
::
FindFlags
flags
,
bool
incremental
)
bool
incremental
,
bool
*
wrapped
)
{
return
currentHelpViewer
()
->
findText
(
txt
,
flags
,
incremental
,
false
);
return
currentHelpViewer
()
->
findText
(
txt
,
flags
,
incremental
,
false
,
wrapped
);
}
// -- public slots
...
...
src/plugins/help/centralwidget.h
View file @
7915ce6b
...
...
@@ -73,7 +73,7 @@ public:
void
setCurrentPage
(
HelpViewer
*
page
);
bool
find
(
const
QString
&
txt
,
Find
::
FindFlags
findFlags
,
bool
incremental
);
bool
incremental
,
bool
*
wrapped
=
0
);
public
slots
:
void
copy
();
...
...
src/plugins/help/helpfindsupport.cpp
View file @
7915ce6b
...
...
@@ -75,16 +75,24 @@ QString HelpFindSupport::completedFindString() const
Find
::
IFindSupport
::
Result
HelpFindSupport
::
findIncremental
(
const
QString
&
txt
,
Find
::
FindFlags
findFlags
)
{
QTC_ASSERT
(
m_centralWidget
,
return
NotFound
);
findFlags
&=
~
Find
::
FindBackward
;
return
m_centralWidget
->
find
(
txt
,
findFlags
,
true
)
?
Found
:
NotFound
;
return
find
(
txt
,
findFlags
,
true
)
?
Found
:
NotFound
;
}
Find
::
IFindSupport
::
Result
HelpFindSupport
::
findStep
(
const
QString
&
txt
,
Find
::
FindFlags
findFlags
)
{
QTC_ASSERT
(
m_centralWidget
,
return
NotFound
);
return
m_centralWidget
->
find
(
txt
,
findFlags
,
false
)
?
Found
:
NotFound
;
return
find
(
txt
,
findFlags
,
false
)
?
Found
:
NotFound
;
}
bool
HelpFindSupport
::
find
(
const
QString
&
txt
,
Find
::
FindFlags
findFlags
,
bool
incremental
)
{
QTC_ASSERT
(
m_centralWidget
,
return
false
);
bool
wrapped
=
false
;
bool
found
=
m_centralWidget
->
find
(
txt
,
findFlags
,
incremental
,
&
wrapped
);
if
(
wrapped
)
showWrapIndicator
(
m_centralWidget
);
return
found
;
}
// -- HelpViewerFindSupport
...
...
@@ -125,5 +133,9 @@ bool HelpViewerFindSupport::find(const QString &txt,
Find
::
FindFlags
findFlags
,
bool
incremental
)
{
QTC_ASSERT
(
m_viewer
,
return
false
);
return
m_viewer
->
findText
(
txt
,
findFlags
,
incremental
,
false
);
bool
wrapped
=
false
;
bool
found
=
m_viewer
->
findText
(
txt
,
findFlags
,
incremental
,
false
,
&
wrapped
);
if
(
wrapped
)
showWrapIndicator
(
m_viewer
);
return
found
;
}
src/plugins/help/helpviewer.h
View file @
7915ce6b
...
...
@@ -87,7 +87,7 @@ public:
bool
isBackwardAvailable
()
const
;
bool
findText
(
const
QString
&
text
,
Find
::
FindFlags
flags
,
bool
incremental
,
bool
fromSearch
);
bool
incremental
,
bool
fromSearch
,
bool
*
wrapped
=
0
);
static
const
QString
NsNokia
;
static
const
QString
NsTrolltech
;
...
...
src/plugins/help/helpviewer_qtb.cpp
View file @
7915ce6b
...
...
@@ -191,8 +191,10 @@ bool HelpViewer::isBackwardAvailable() const
}
bool
HelpViewer
::
findText
(
const
QString
&
text
,
Find
::
FindFlags
flags
,
bool
incremental
,
bool
fromSearch
)
bool
incremental
,
bool
fromSearch
,
bool
*
wrapped
)
{
if
(
wrapped
)
*
wrapped
=
false
;
QTextDocument
*
doc
=
document
();
QTextCursor
cursor
=
textCursor
();
if
(
!
doc
||
cursor
.
isNull
())
...
...
@@ -210,6 +212,8 @@ bool HelpViewer::findText(const QString &text, Find::FindFlags flags,
else
cursor
.
movePosition
(
QTextCursor
::
End
);
found
=
doc
->
find
(
text
,
cursor
,
f
);
if
(
!
found
.
isNull
()
&&
wrapped
)
*
wrapped
=
true
;
}
if
(
fromSearch
)
{
...
...
src/plugins/help/helpviewer_qwv.cpp
View file @
7915ce6b
...
...
@@ -344,17 +344,25 @@ bool HelpViewer::isBackwardAvailable() const
}
bool
HelpViewer
::
findText
(
const
QString
&
text
,
Find
::
FindFlags
flags
,
bool
incremental
,
bool
fromSearch
)
bool
incremental
,
bool
fromSearch
,
bool
*
wrapped
)
{
Q_UNUSED
(
incremental
);
Q_UNUSED
(
fromSearch
);
QWebPage
::
FindFlags
options
=
QWebPage
::
FindWrapsAroundDocument
;
if
(
wrapped
)
*
wrapped
=
false
;
QWebPage
::
FindFlags
options
;
if
(
flags
&
Find
::
FindBackward
)
options
|=
QWebPage
::
FindBackward
;
if
(
flags
&
Find
::
FindCaseSensitively
)
options
|=
QWebPage
::
FindCaseSensitively
;
bool
found
=
QWebView
::
findText
(
text
,
options
);
if
(
!
found
)
{
options
|=
QWebPage
::
FindWrapsAroundDocument
;
found
=
QWebView
::
findText
(
text
,
options
);
if
(
found
&&
wrapped
)
*
wrapped
=
true
;
}
options
=
QWebPage
::
HighlightAllOccurrences
;
QWebView
::
findText
(
QLatin1String
(
""
),
options
);
// clear first
QWebView
::
findText
(
text
,
options
);
// force highlighting of all other matches
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment