Qt 5.7为我的项目实现了我自己的类小部件

时间:2016-12-06 09:01:04

标签: c++ qt qscintilla

我想创建类似网页编辑器的东西,带有预览功能。为此,我使用高亮功能创建了我的编辑器......我使用WebEngigne类进行预览。

我的问题是我无法在我的项目中添加编辑器类。 这是我的编辑代码:KeyPressEvent doesn't work with Qscintilla Library (Qt)

还有我的IDE代码: mainwindows.h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow:public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H

mainwindows.cpp

#include "mainwindow.h"
#include "texteditor.h"
#include "ui_mainwindow.h"

#include <QtWebEngineWidgets>
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QWebEngineView *preview = new QWebEngineView();
    QWebEngineView *mixedPreview = new QWebEngineView();

    textEditor editor;

    preview->load(QUrl("https://google.com/"));
    mixedPreview->load(QUrl("https://google.com/"));

    this->ui->editorLayout->addWidget(&editor);
    this->ui->WebPreviewLayout->addWidget(preview);
    this->ui->WebMixedLayout->addWidget(mixedPreview);

    //QWebEngineView *mixed_browse=new QWebEngineView();

}

MainWindow::~MainWindow()
{
    delete ui;
}

我的主要课程只是打电话给主窗口课程。

我希望有人会帮助我,很快见到你。 BEY

0 个答案:

没有答案
相关问题