Skip to content
GitLab
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
3ad22e33
Commit
3ad22e33
authored
Mar 18, 2009
by
hjk
Browse files
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
parents
da1492cf
0a48bd87
Changes
32
Hide whitespace changes
Inline
Side-by-side
src/libs/utils/filewizardpage.cpp
View file @
3ad22e33
...
...
@@ -88,6 +88,7 @@ void FileWizardPage::setName(const QString &name)
void
FileWizardPage
::
changeEvent
(
QEvent
*
e
)
{
QWizardPage
::
changeEvent
(
e
);
switch
(
e
->
type
())
{
case
QEvent
::
LanguageChange
:
m_d
->
m_ui
.
retranslateUi
(
this
);
...
...
src/libs/utils/projectintropage.cpp
View file @
3ad22e33
...
...
@@ -113,6 +113,7 @@ void ProjectIntroPage::setDescription(const QString &description)
void
ProjectIntroPage
::
changeEvent
(
QEvent
*
e
)
{
QWizardPage
::
changeEvent
(
e
);
switch
(
e
->
type
())
{
case
QEvent
::
LanguageChange
:
m_d
->
m_ui
.
retranslateUi
(
this
);
...
...
src/libs/utils/submiteditorwidget.cpp
View file @
3ad22e33
...
...
@@ -366,6 +366,7 @@ bool SubmitEditorWidget::hasCheckedFiles() const
void
SubmitEditorWidget
::
changeEvent
(
QEvent
*
e
)
{
QWidget
::
changeEvent
(
e
);
switch
(
e
->
type
())
{
case
QEvent
::
LanguageChange
:
m_d
->
m_ui
.
retranslateUi
(
this
);
...
...
src/plugins/coreplugin/mainwindow.cpp
View file @
3ad22e33
...
...
@@ -986,6 +986,7 @@ void MainWindow::removeContextObject(IContext *context)
void
MainWindow
::
changeEvent
(
QEvent
*
e
)
{
QMainWindow
::
changeEvent
(
e
);
if
(
e
->
type
()
==
QEvent
::
ActivationChange
)
{
if
(
isActiveWindow
())
{
if
(
debugMainWindow
)
...
...
src/plugins/cppeditor/cppeditor.cpp
View file @
3ad22e33
...
...
@@ -185,6 +185,7 @@ CPPEditor::CPPEditor(QWidget *parent)
{
setParenthesesMatchingEnabled
(
true
);
setMarksVisible
(
true
);
setCodeFoldingSupported
(
true
);
setCodeFoldingVisible
(
true
);
baseTextDocument
()
->
setSyntaxHighlighter
(
new
CppHighlighter
);
// new QShortcut(QKeySequence("Ctrl+Alt+M"), this, SLOT(foo()), 0, Qt::WidgetShortcut);
...
...
src/plugins/cppeditor/cppeditor.pro
View file @
3ad22e33
...
...
@@ -8,7 +8,6 @@ include(../../qworkbenchplugin.pri)
include
(
cppeditor_dependencies
.
pri
)
HEADERS
+=
cppplugin
.
h
\
cppeditor
.
h
\
cppeditoractionhandler
.
h
\
cpphighlighter
.
h
\
cpphoverhandler
.
h
\
cppfilewizard
.
h
\
...
...
@@ -16,13 +15,10 @@ HEADERS += cppplugin.h \
cppeditorenums
.
h
\
cppeditor_global
.
h
\
cppclasswizard
.
h
SOURCES
+=
cppplugin
.
cpp
\
cppeditoractionhandler
.
cpp
\
cppeditor
.
cpp
\
cpphighlighter
.
cpp
\
cpphoverhandler
.
cpp
\
cppfilewizard
.
cpp
\
cppclasswizard
.
cpp
RESOURCES
+=
cppeditor
.
qrc
src/plugins/cppeditor/cppeditoractionhandler.cpp
deleted
100644 → 0
View file @
da1492cf
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#include
"cppeditoractionhandler.h"
#include
"cppeditorconstants.h"
#include
"cppeditor.h"
#include
<QAction>
using
namespace
CppEditor
::
Internal
;
CPPEditorActionHandler
::
CPPEditorActionHandler
(
const
QString
&
context
,
uint
optionalActions
)
:
TextEditor
::
TextEditorActionHandler
(
context
,
optionalActions
)
{
}
CPPEditorActionHandler
::~
CPPEditorActionHandler
()
{
}
void
CPPEditorActionHandler
::
createActions
()
{
TextEditor
::
TextEditorActionHandler
::
createActions
();
}
void
CPPEditorActionHandler
::
updateActions
(
UpdateMode
um
)
{
TextEditor
::
TextEditorActionHandler
::
updateActions
(
um
);
}
src/plugins/cppeditor/cppeditoractionhandler.h
deleted
100644 → 0
View file @
da1492cf
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#ifndef CPPEDITORACTIONHANDLER_H
#define CPPEDITORACTIONHANDLER_H
#include
<texteditor/texteditoractionhandler.h>
namespace
CppEditor
{
namespace
Internal
{
class
CPPEditorActionHandler
:
public
TextEditor
::
TextEditorActionHandler
{
Q_OBJECT
public:
CPPEditorActionHandler
(
const
QString
&
context
,
uint
optionalActions
=
None
);
virtual
~
CPPEditorActionHandler
();
using
TextEditor
::
TextEditorActionHandler
::
updateActions
;
protected:
virtual
void
createActions
();
virtual
void
updateActions
(
UpdateMode
um
);
};
}
// namespace Internal
}
// namespace CppEditor
#endif // CPPEDITORACTIONHANDLER_H
src/plugins/cppeditor/cppplugin.cpp
View file @
3ad22e33
...
...
@@ -30,7 +30,6 @@
#include
"cppplugin.h"
#include
"cppclasswizard.h"
#include
"cppeditor.h"
#include
"cppeditoractionhandler.h"
#include
"cppeditorconstants.h"
#include
"cppeditorenums.h"
#include
"cppfilewizard.h"
...
...
@@ -47,6 +46,8 @@
#include
<texteditor/completionsupport.h>
#include
<texteditor/fontsettings.h>
#include
<texteditor/storagesettings.h>
#include
<texteditor/texteditoractionhandler.h>
#include
<texteditor/texteditorplugin.h>
#include
<texteditor/texteditorsettings.h>
#include
<cpptools/cpptoolsconstants.h>
...
...
@@ -60,9 +61,9 @@ static const char *sourceSuffixKeyC = "CppEditor/SourceSuffix";
using
namespace
CppEditor
::
Internal
;
//////////////////////////// Cpp
Plugin
EditorFactory /////////////////////////////
//////////////////////////// CppEditorFactory /////////////////////////////
Cpp
Plugin
EditorFactory
::
Cpp
Plugin
EditorFactory
(
CppPlugin
*
owner
)
:
CppEditorFactory
::
CppEditorFactory
(
CppPlugin
*
owner
)
:
m_kind
(
QLatin1String
(
CppEditor
::
Constants
::
CPPEDITOR_KIND
)),
m_owner
(
owner
)
{
...
...
@@ -77,18 +78,18 @@ CppPluginEditorFactory::CppPluginEditorFactory(CppPlugin *owner) :
QLatin1String
(
"h"
));
}
QString
Cpp
Plugin
EditorFactory
::
kind
()
const
QString
CppEditorFactory
::
kind
()
const
{
return
m_kind
;
}
Core
::
IFile
*
Cpp
Plugin
EditorFactory
::
open
(
const
QString
&
fileName
)
Core
::
IFile
*
CppEditorFactory
::
open
(
const
QString
&
fileName
)
{
Core
::
IEditor
*
iface
=
Core
::
EditorManager
::
instance
()
->
openEditor
(
fileName
,
kind
());
return
iface
?
iface
->
file
()
:
0
;
}
Core
::
IEditor
*
Cpp
Plugin
EditorFactory
::
createEditor
(
QWidget
*
parent
)
Core
::
IEditor
*
CppEditorFactory
::
createEditor
(
QWidget
*
parent
)
{
CPPEditor
*
editor
=
new
CPPEditor
(
parent
);
editor
->
setRevisionsVisible
(
true
);
...
...
@@ -97,7 +98,7 @@ Core::IEditor *CppPluginEditorFactory::createEditor(QWidget *parent)
return
editor
->
editableInterface
();
}
QStringList
Cpp
Plugin
EditorFactory
::
mimeTypes
()
const
QStringList
CppEditorFactory
::
mimeTypes
()
const
{
return
m_mimeTypes
;
}
...
...
@@ -128,25 +129,9 @@ CppPlugin *CppPlugin::instance()
void
CppPlugin
::
initializeEditor
(
CPPEditor
*
editor
)
{
// common actions
m_actionHandler
->
setupActions
(
editor
);
// settings
TextEditor
::
TextEditorSettings
*
settings
=
TextEditor
::
TextEditorSettings
::
instance
();
connect
(
settings
,
SIGNAL
(
fontSettingsChanged
(
TextEditor
::
FontSettings
)),
editor
,
SLOT
(
setFontSettings
(
TextEditor
::
FontSettings
)));
connect
(
settings
,
SIGNAL
(
tabSettingsChanged
(
TextEditor
::
TabSettings
)),
editor
,
SLOT
(
setTabSettings
(
TextEditor
::
TabSettings
)));
connect
(
settings
,
SIGNAL
(
storageSettingsChanged
(
TextEditor
::
StorageSettings
)),
editor
,
SLOT
(
setStorageSettings
(
TextEditor
::
StorageSettings
)));
connect
(
settings
,
SIGNAL
(
displaySettingsChanged
(
TextEditor
::
DisplaySettings
)),
editor
,
SLOT
(
setDisplaySettings
(
TextEditor
::
DisplaySettings
)));
// tab settings rely on font settings
editor
->
setFontSettings
(
settings
->
fontSettings
());
editor
->
setTabSettings
(
settings
->
tabSettings
());
editor
->
setStorageSettings
(
settings
->
storageSettings
());
editor
->
setDisplaySettings
(
settings
->
displaySettings
());
TextEditor
::
TextEditorSettings
::
instance
()
->
initializeEditor
(
editor
);
// auto completion
connect
(
editor
,
SIGNAL
(
requestAutoCompletion
(
ITextEditable
*
,
bool
)),
...
...
@@ -159,7 +144,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
if
(
!
core
->
mimeDatabase
()
->
addMimeTypes
(
QLatin1String
(
":/cppeditor/CppEditor.mimetypes.xml"
),
errorMessage
))
return
false
;
m_factory
=
new
Cpp
Plugin
EditorFactory
(
this
);
m_factory
=
new
CppEditorFactory
(
this
);
addObject
(
m_factory
);
addAutoReleasedObject
(
new
CppHoverHandler
);
...
...
@@ -207,7 +192,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
am
->
actionContainer
(
CppEditor
::
Constants
::
M_CONTEXT
)
->
addAction
(
cmd
);
am
->
actionContainer
(
CppTools
::
Constants
::
M_TOOLS_CPP
)
->
addAction
(
cmd
);
m_actionHandler
=
new
CPP
EditorActionHandler
(
CppEditor
::
Constants
::
C_CPPEDITOR
,
m_actionHandler
=
new
TextEditor
::
Text
EditorActionHandler
(
CppEditor
::
Constants
::
C_CPPEDITOR
,
TextEditor
::
TextEditorActionHandler
::
Format
|
TextEditor
::
TextEditorActionHandler
::
UnCommentSelection
|
TextEditor
::
TextEditorActionHandler
::
UnCollapseAll
);
...
...
src/plugins/cppeditor/cppplugin.h
View file @
3ad22e33
...
...
@@ -44,8 +44,7 @@ namespace CppEditor {
namespace
Internal
{
class
CPPEditor
;
class
CPPEditorActionHandler
;
class
CppPluginEditorFactory
;
class
CppEditorFactory
;
class
CppPlugin
:
public
ExtensionSystem
::
IPlugin
{
...
...
@@ -68,21 +67,21 @@ private slots:
void
jumpToDefinition
();
private:
friend
class
Cpp
Plugin
EditorFactory
;
friend
class
CppEditorFactory
;
Core
::
IEditor
*
createEditor
(
QWidget
*
parent
);
static
CppPlugin
*
m_instance
;
CPP
EditorActionHandler
*
m_actionHandler
;
Cpp
Plugin
EditorFactory
*
m_factory
;
TextEditor
::
Text
EditorActionHandler
*
m_actionHandler
;
CppEditorFactory
*
m_factory
;
};
class
Cpp
Plugin
EditorFactory
:
public
Core
::
IEditorFactory
class
CppEditorFactory
:
public
Core
::
IEditorFactory
{
Q_OBJECT
public:
Cpp
Plugin
EditorFactory
(
CppPlugin
*
owner
);
CppEditorFactory
(
CppPlugin
*
owner
);
virtual
QStringList
mimeTypes
()
const
;
...
...
src/plugins/genericprojectmanager/genericprojectfileseditor.cpp
View file @
3ad22e33
...
...
@@ -39,7 +39,7 @@ Manager *ProjectFilesFactory::manager() const
Core
::
IEditor
*
ProjectFilesFactory
::
createEditor
(
QWidget
*
parent
)
{
ProjectFilesEditor
*
ed
=
new
ProjectFilesEditor
(
parent
,
this
,
_actionHandler
);
ed
->
initialize
(
);
TextEditor
::
TextEditorSettings
::
instance
()
->
initialize
Editor
(
ed
);
return
ed
->
editableInterface
();
}
...
...
@@ -98,7 +98,7 @@ Core::IEditor *ProjectFilesEditable::duplicate(QWidget *parent)
ProjectFilesEditor
*
editor
=
new
ProjectFilesEditor
(
parent
,
parentEditor
->
factory
(),
parentEditor
->
actionHandler
());
editor
->
initialize
(
);
TextEditor
::
TextEditorSettings
::
instance
()
->
initializeEditor
(
editor
);
return
editor
->
editableInterface
();
}
...
...
@@ -122,16 +122,6 @@ ProjectFilesEditor::ProjectFilesEditor(QWidget *parent, ProjectFilesFactory *fac
ProjectFilesEditor
::~
ProjectFilesEditor
()
{
}
void
ProjectFilesEditor
::
initialize
()
{
TextEditor
::
TextEditorSettings
*
settings
=
TextEditor
::
TextEditorSettings
::
instance
();
connect
(
settings
,
SIGNAL
(
fontSettingsChanged
(
const
TextEditor
::
FontSettings
&
)),
this
,
SLOT
(
setFontSettings
(
const
TextEditor
::
FontSettings
&
)));
setFontSettings
(
settings
->
fontSettings
());
}
ProjectFilesFactory
*
ProjectFilesEditor
::
factory
()
const
{
return
_factory
;
...
...
src/plugins/genericprojectmanager/genericprojectfileseditor.h
View file @
3ad22e33
...
...
@@ -64,8 +64,6 @@ public:
TextEditor
::
TextEditorActionHandler
*
handler
);
virtual
~
ProjectFilesEditor
();
void
initialize
();
ProjectFilesFactory
*
factory
()
const
;
TextEditor
::
TextEditorActionHandler
*
actionHandler
()
const
;
...
...
src/plugins/git/branchdialog.cpp
View file @
3ad22e33
...
...
@@ -258,6 +258,7 @@ void BranchDialog::slotRemoteBranchActivated(const QModelIndex &i)
void
BranchDialog
::
changeEvent
(
QEvent
*
e
)
{
QDialog
::
changeEvent
(
e
);
switch
(
e
->
type
())
{
case
QEvent
::
LanguageChange
:
m_ui
->
retranslateUi
(
this
);
...
...
src/plugins/git/branchdialog.h
View file @
3ad22e33
...
...
@@ -3,64 +3,68 @@
#include
<QtGui/QDialog>
QT_BEGIN_NAMESPACE
class
QPushButton
;
class
QModelIndex
;
QT_END_NAMESPACE
namespace
Git
{
namespace
Internal
{
namespace
Ui
{
class
BranchDialog
;
}
class
GitClient
;
class
LocalBranchModel
;
class
RemoteBranchModel
;
/* Branch dialog: Display a list of local branches at the top
* and remote branches below. Offers to checkout/delete local
* branches.
* TODO: Add new branch (optionally tracking a remote one).
* How to find out that a local branch is a tracking one? */
class
BranchDialog
:
public
QDialog
{
Q_OBJECT
Q_DISABLE_COPY
(
BranchDialog
)
public:
explicit
BranchDialog
(
QWidget
*
parent
=
0
);
bool
init
(
GitClient
*
client
,
const
QString
&
workingDirectory
,
QString
*
errorMessage
);
virtual
~
BranchDialog
();
protected:
virtual
void
changeEvent
(
QEvent
*
e
);
private
slots
:
void
slotEnableButtons
();
void
slotCheckoutSelectedBranch
();
void
slotDeleteSelectedBranch
();
void
slotLocalBranchActivated
();
void
slotRemoteBranchActivated
(
const
QModelIndex
&
);
void
slotCreateLocalBranch
(
const
QString
&
branchName
);
private:
bool
ask
(
const
QString
&
title
,
const
QString
&
what
,
bool
defaultButton
);
void
selectLocalBranch
(
const
QString
&
b
);
int
selectedLocalBranchIndex
()
const
;
int
selectedRemoteBranchIndex
()
const
;
GitClient
*
m_client
;
Ui
::
BranchDialog
*
m_ui
;
QPushButton
*
m_checkoutButton
;
QPushButton
*
m_deleteButton
;
LocalBranchModel
*
m_localModel
;
RemoteBranchModel
*
m_remoteModel
;
QString
m_repoDirectory
;
};
}
// namespace Internal
namespace
Internal
{
namespace
Ui
{
class
BranchDialog
;
}
class
GitClient
;
class
LocalBranchModel
;
class
RemoteBranchModel
;
/**
* Branch dialog. Displays a list of local branches at the top and remote
* branches below. Offers to checkout/delete local branches.
*
* TODO: Add new branch (optionally tracking a remote one).
* How to find out that a local branch is a tracking one?
*/
class
BranchDialog
:
public
QDialog
{
Q_OBJECT
Q_DISABLE_COPY
(
BranchDialog
)
public:
explicit
BranchDialog
(
QWidget
*
parent
=
0
);
bool
init
(
GitClient
*
client
,
const
QString
&
workingDirectory
,
QString
*
errorMessage
);
virtual
~
BranchDialog
();
protected:
virtual
void
changeEvent
(
QEvent
*
e
);
private
slots
:
void
slotEnableButtons
();
void
slotCheckoutSelectedBranch
();
void
slotDeleteSelectedBranch
();
void
slotLocalBranchActivated
();
void
slotRemoteBranchActivated
(
const
QModelIndex
&
);
void
slotCreateLocalBranch
(
const
QString
&
branchName
);
private:
bool
ask
(
const
QString
&
title
,
const
QString
&
what
,
bool
defaultButton
);
void
selectLocalBranch
(
const
QString
&
b
);
int
selectedLocalBranchIndex
()
const
;
int
selectedRemoteBranchIndex
()
const
;
GitClient
*
m_client
;
Ui
::
BranchDialog
*
m_ui
;
QPushButton
*
m_checkoutButton
;
QPushButton
*
m_deleteButton
;
LocalBranchModel
*
m_localModel
;
RemoteBranchModel
*
m_remoteModel
;
QString
m_repoDirectory
;
};
}
// namespace Internal
}
// namespace Git
#endif // BRANCHDIALOG_H
src/plugins/help/helpfindsupport.cpp
View file @
3ad22e33
...
...
@@ -78,3 +78,67 @@ bool HelpFindSupport::findStep(const QString &txt, QTextDocument::FindFlags find
QTC_ASSERT
(
m_centralWidget
,
return
false
);
return
m_centralWidget
->
find
(
txt
,
findFlags
,
false
);
}
HelpViewerFindSupport
::
HelpViewerFindSupport
(
HelpViewer
*
viewer
)
:
m_viewer
(
viewer
)
{
}
QString
HelpViewerFindSupport
::
currentFindString
()
const
{
QTC_ASSERT
(
m_viewer
,
return
QString
());
return
m_viewer
->
selectedText
();
}
bool
HelpViewerFindSupport
::
findIncremental
(
const
QString
&
txt
,
QTextDocument
::
FindFlags
findFlags
)
{
QTC_ASSERT
(
m_viewer
,
return
false
);
findFlags
&=
~
QTextDocument
::
FindBackward
;
return
find
(
txt
,
findFlags
,
true
);
}
bool
HelpViewerFindSupport
::
findStep
(
const
QString
&
txt
,
QTextDocument
::
FindFlags
findFlags
)
{
QTC_ASSERT
(
m_viewer
,
return
false
);
return
find
(
txt
,
findFlags
,
false
);
}
bool
HelpViewerFindSupport
::
find
(
const
QString
&
txt
,
QTextDocument
::
FindFlags
findFlags
,
bool
incremental
)
{
QTC_ASSERT
(
m_viewer
,
return
false
);
#if !defined(QT_NO_WEBKIT)
Q_UNUSED
(
incremental
);
QWebPage
::
FindFlags
options
=
QWebPage
::
FindWrapsAroundDocument
;
if
(
findFlags
&
QTextDocument
::
FindBackward
)
options
|=
QWebPage
::
FindBackward
;
if
(
findFlags
&
QTextDocument
::
FindCaseSensitively
)
options
|=
QWebPage
::
FindCaseSensitively
;
return
m_viewer
->
findText
(
txt
,
options
);
#else
QTextCursor
cursor
=
viewer
->
textCursor
();
QTextDocument
*
doc
=
viewer
->
document
();
QTextBrowser
*
browser
=
qobject_cast
<
QTextBrowser
*>
(
viewer
);
if
(
!
browser
||
!
doc
||
cursor
.
isNull
())
return
false
;
if
(
incremental
)
cursor
.
setPosition
(
cursor
.
selectionStart
());
QTextCursor
found
=
doc
->
find
(
txt
,
cursor
,
findFlags
);
if
(
found
.
isNull
())
{
if
((
findFlags
&
QTextDocument
::
FindBackward
)
==
0
)
cursor
.
movePosition
(
QTextCursor
::
Start
);
else
cursor
.
movePosition
(
QTextCursor
::
End
);
found
=
doc
->
find
(
txt
,
cursor
,
findFlags
);
if
(
found
.
isNull
())
{
return
false
;
}
}
if
(
!
found
.
isNull
())
{
viewer
->
setTextCursor
(
found
);
}
return
true
;
#endif
}
src/plugins/help/helpfindsupport.h
View file @
3ad22e33
...
...
@@ -34,6 +34,10 @@
#include
<find/ifindsupport.h>
QT_BEGIN_NAMESPACE
class
HelpViewer
;
QT_END_NAMESPACE
namespace
Help
{
namespace
Internal
{
...
...
@@ -65,6 +69,31 @@ private:
CentralWidget
*
m_centralWidget
;
};
class
HelpViewerFindSupport
:
public
Find
::
IFindSupport
{
Q_OBJECT
public:
HelpViewerFindSupport
(
HelpViewer
*
viewer
);
bool
isEnabled
()
const
{
return
true
;
}
bool
supportsReplace
()
const
{
return
false
;
}
void
resetIncrementalSearch
()
{}
void
clearResults
()
{}
QString
currentFindString
()
const
;
QString
completedFindString
()
const
{
return
QString
();
}
bool
findIncremental
(
const
QString
&
txt
,
QTextDocument
::
FindFlags
findFlags
);
bool
findStep
(
const
QString
&
txt
,
QTextDocument
::
FindFlags
findFlags
);
bool
replaceStep
(
const
QString
&
,
const
QString
&
,
QTextDocument
::
FindFlags
)
{
return
false
;
}
int
replaceAll
(
const
QString
&
,
const
QString
&
,
QTextDocument
::
FindFlags
)
{
return
0
;
}
private:
bool
find
(
const
QString
&
ttf
,
QTextDocument
::
FindFlags
findFlags
,
bool
incremental
);
HelpViewer
*
m_viewer
;
};
}
// namespace Internal
}
// namespace Help
...
...
src/plugins/help/helpplugin.cpp
View file @
3ad22e33
...
...
@@ -373,6 +373,9 @@ void HelpPlugin::createRightPaneSideBar()