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
Utilities
Kate
Commits
1a1e2545
Commit
1a1e2545
authored
Sep 03, 2022
by
Christoph Cullmann
🍨
Browse files
adapt to addWidget KTextEditor::MainWindow API
parent
d8d757c5
Pipeline
#226877
passed with stage
in 6 minutes and 48 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
addons/compiler-explorer/ce_plugin.cpp
View file @
1a1e2545
...
...
@@ -53,7 +53,7 @@ void CEPluginView::openANewTab()
QWidget
*
mw
=
m_mainWindow
->
window
();
// clang-format off
QMetaObject
::
invokeMethod
(
mw
,
"addWidget
AsTab
"
,
Q_ARG
(
QWidget
*
,
m_mainWidget
));
QMetaObject
::
invokeMethod
(
mw
,
"addWidget"
,
Q_ARG
(
QWidget
*
,
m_mainWidget
));
// clang-format on
}
...
...
apps/lib/katemainwindow.cpp
View file @
1a1e2545
...
...
@@ -1302,10 +1302,11 @@ QObject *KateMainWindow::pluginView(const QString &name)
return
m_pluginViews
.
contains
(
plugin
)
?
m_pluginViews
.
value
(
plugin
)
:
nullptr
;
}
void
KateMainWindow
::
addWidget
AsTab
(
QWidget
*
widget
)
bool
KateMainWindow
::
addWidget
(
QWidget
*
widget
)
{
auto
vs
=
m_viewManager
->
activeViewSpace
();
vs
->
addWidgetAsTab
(
widget
);
return
true
;
}
void
KateMainWindow
::
showDiff
(
const
QByteArray
&
wordDiff
,
const
DiffParams
&
params
)
...
...
@@ -1319,7 +1320,7 @@ void KateMainWindow::showDiff(const QByteArray &wordDiff, const DiffParams ¶
else
w
->
setWindowTitle
(
i18n
(
"Diff %1..%2"
,
Utils
::
fileNameFromPath
(
params
.
srcFile
),
Utils
::
fileNameFromPath
(
params
.
destFile
)));
}
addWidget
AsTab
(
w
);
addWidget
(
w
);
w
->
openDiff
(
wordDiff
);
}
...
...
apps/lib/katemainwindow.h
View file @
1a1e2545
...
...
@@ -511,7 +511,16 @@ public Q_SLOTS:
*/
QObject
*
pluginView
(
const
QString
&
name
);
void
addWidgetAsTab
(
QWidget
*
widget
);
/**
* Add a widget to the main window.
* This is useful to show non-KTextEditor::View widgets in the main window.
* The host application should try to manage this like some KTextEditor::View (e.g. as a tab) and provide
* the means to close it.
* \param widget widget to add
* \return success, if false, the plugin needs to take care to show the widget itself, otherwise
* the main window will take ownership of the widget
*/
bool
addWidget
(
QWidget
*
widget
);
void
showDiff
(
const
QByteArray
&
wordDiff
,
const
DiffParams
&
params
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment