cutter/src/widgets/JupyterWidget.h

63 lines
995 B
C
Raw Normal View History

2017-12-13 17:36:00 +00:00
#ifndef JUPYTERWIDGET_H
#define JUPYTERWIDGET_H
2018-03-02 13:15:53 +00:00
#ifdef CUTTER_ENABLE_JUPYTER
2017-12-13 17:36:00 +00:00
#include <memory>
#include <QDockWidget>
#include "utils/JupyterConnection.h"
namespace Ui
{
class JupyterWidget;
}
class JupyterWebView;
class JupyterWidget : public QDockWidget
{
Q_OBJECT
public:
JupyterWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~JupyterWidget();
2018-03-02 13:15:53 +00:00
#ifdef CUTTER_ENABLE_QTWEBENGINE
2017-12-13 17:36:00 +00:00
JupyterWebView *createNewTab();
2018-03-02 13:15:53 +00:00
#endif
2017-12-13 17:36:00 +00:00
private slots:
void urlReceived(const QString &url);
2018-02-22 18:39:20 +00:00
void creationFailed();
2017-12-13 17:36:00 +00:00
private:
std::unique_ptr<Ui::JupyterWidget> ui;
};
2018-03-02 13:15:53 +00:00
#ifdef CUTTER_ENABLE_QTWEBENGINE
#include <QWebEngineView>
2017-12-13 17:36:00 +00:00
class JupyterWebView : public QWebEngineView
{
Q_OBJECT
public:
JupyterWebView(JupyterWidget *mainWidget, QWidget *parent = nullptr);
protected:
QWebEngineView *createWindow(QWebEnginePage::WebWindowType type) override;
private:
JupyterWidget *mainWidget;
};
2018-03-02 13:15:53 +00:00
#endif
#endif
2017-12-13 17:36:00 +00:00
#endif //JUPYTERWIDGET_H