織夢(mèng)導(dǎo)航網(wǎng)站模板營銷推廣策略
本文主要介紹了第二種實(shí)現(xiàn)帶行號(hào)的支持高亮的編輯器的方式,基于QTextEdit實(shí)現(xiàn)的,支持自定義邊框,背景,顏色,以及滾動(dòng)條樣式,支持輸入變色,復(fù)制文本到里面變色,支持替換,是一個(gè)純專業(yè)項(xiàng)目使用的編輯器
先上效果圖:
1.頭文件ContentTextEdit.h
#ifndef CONTENT_TEXT_EDIT_H
#define CONTENT_TEXT_EDIT_H#include <QTextEdit>class ContentTextEdit : public QTextEdit
{Q_OBJECT
public:explicit ContentTextEdit(QWidget *parent = Q_NULLPTR);~ContentTextEdit();protected:virtual void insertFromMimeData(const QMimeData *source) override;//響應(yīng)粘貼事件,ctrl+vsignals:void signalPas