forked from qt-creator/qt-creator
DiffEditor: Fix editor actions
The text editor widgets all need a TextEditorActionHandler that takes care of the editor actions for them. Each text editor needs its own context, so the editor with focus receives the actions. This does not happen automatically for these text editors, since the diff editor manages these itself. Task-number: QTCREATORBUG-9445 Change-Id: Ib42f095ec23550e401e8ee9b36f3f49517a22877 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QWidget)
|
||||
|
||||
namespace TextEditor { class TextEditorWidget; }
|
||||
|
||||
namespace DiffEditor {
|
||||
|
||||
class DiffEditorController;
|
||||
@@ -44,9 +46,6 @@ class DiffEditorDocument;
|
||||
class SideBySideDiffEditorWidget;
|
||||
class UnifiedDiffEditorWidget;
|
||||
|
||||
const char SIDE_BY_SIDE_VIEW_ID[] = "SideBySide";
|
||||
const char UNIFIED_VIEW_ID[] = "Unified";
|
||||
|
||||
class IDiffView : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -96,6 +95,8 @@ public:
|
||||
UnifiedView();
|
||||
|
||||
QWidget *widget();
|
||||
TextEditor::TextEditorWidget *textEditorWidget();
|
||||
|
||||
void setDocument(DiffEditorDocument *document);
|
||||
|
||||
void beginOperation();
|
||||
@@ -106,7 +107,7 @@ public:
|
||||
void setSync(bool sync);
|
||||
|
||||
private:
|
||||
UnifiedDiffEditorWidget *m_widget;
|
||||
UnifiedDiffEditorWidget *m_widget = nullptr;
|
||||
};
|
||||
|
||||
class SideBySideView : public IDiffView
|
||||
@@ -117,6 +118,9 @@ public:
|
||||
SideBySideView();
|
||||
|
||||
QWidget *widget();
|
||||
TextEditor::TextEditorWidget *leftEditorWidget();
|
||||
TextEditor::TextEditorWidget *rightEditorWidget();
|
||||
|
||||
void setDocument(DiffEditorDocument *document);
|
||||
|
||||
void beginOperation();
|
||||
|
||||
Reference in New Issue
Block a user