QmlProfiler: relay context menu from trace view to parent widget

As QQuickView is a window with its own event handling, disconnected
from the main window, we need to relay relevant events manually.

Task-number: QTCREATORBUG-11535

Change-Id: If316225ecc01ddc4255c209d7df70a9cee812596
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-02-21 18:34:05 +01:00
parent 676e4f582e
commit 6d8b70ed57
2 changed files with 56 additions and 5 deletions

View File

@@ -75,6 +75,7 @@ public:
bool hasValidSelection() const;
qint64 selectionStart() const;
qint64 selectionEnd() const;
void showContextMenu(QPoint position);
public slots:
void clearDisplay();
@@ -95,6 +96,7 @@ private slots:
protected:
virtual void resizeEvent(QResizeEvent *event);
virtual void contextMenuEvent(QContextMenuEvent *event);
private slots:
void profilerStateChanged();
@@ -117,7 +119,6 @@ signals:
void resized();
private:
void contextMenuEvent(QContextMenuEvent *);
QWidget *createToolbar();
void setRecording(bool recording);
@@ -128,6 +129,14 @@ private:
QmlProfilerTraceViewPrivate *d;
};
class QmlProfilerQuickView : public QQuickView {
public:
QmlProfilerQuickView(QmlProfilerTraceView *parent) : parent(parent) {}
protected:
QmlProfilerTraceView *parent;
bool event(QEvent *ev);
};
} // namespace Internal
} // namespace QmlProfiler