亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qtextedit.cpp

?? qt-x11-opensource-src-4.1.4.tar.gz源碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtGui module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "qtextedit.h"#include "qtextedit_p.h"#include "qlineedit.h"#ifndef QT_NO_TEXTEDIT#include <qfont.h>#include <qpainter.h>#include <qevent.h>#include <qdebug.h>#include <qmime.h>#include <qdrag.h>#include <qclipboard.h>#include <qmenu.h>#include <qstyle.h>#include <qtimer.h>#include "private/qtextdocumentlayout_p.h"#include "qtextdocument.h"#include "qtextlist.h"#include <qtextformat.h>#include <qdatetime.h>#include <qapplication.h>#include <limits.h>#include <qtexttable.h>#include <qvariant.h>#include <qurl.h>#include <qinputcontext.h>#ifndef QT_NO_SHORTCUT#include <qkeysequence.h>#define ACCEL_KEY(k) "\t" + QString(QKeySequence( Qt::CTRL | Qt::Key_ ## k ))#else#define ACCEL_KEY(k) "\t" + QString("Ctrl+" #k)#endifclass QTextEditMimeData : public QMimeData{public:    inline QTextEditMimeData(const QTextDocumentFragment &aFragment) : fragment(aFragment) {}    virtual QStringList formats() const;protected:    virtual QVariant retrieveData(const QString &mimeType, QVariant::Type type) const;private:    void setup() const;    mutable QTextDocumentFragment fragment;};QStringList QTextEditMimeData::formats() const{    if (!fragment.isEmpty())        return QStringList() << "text/plain" << "text/html";    else        return QMimeData::formats();}QVariant QTextEditMimeData::retrieveData(const QString &mimeType, QVariant::Type type) const{    if (!fragment.isEmpty())        setup();    return QMimeData::retrieveData(mimeType, type);}void QTextEditMimeData::setup() const{    QTextEditMimeData *that = const_cast<QTextEditMimeData *>(this);    QString html = fragment.toHtml();    html.replace("<head>", "<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");    that->setData(QLatin1String("text/html"), html.toUtf8());    that->setText(fragment.toPlainText());    fragment = QTextDocumentFragment();}// could go into QTextCursor...static QTextLine currentTextLine(const QTextCursor &cursor){    const QTextBlock block = cursor.block();    if (!block.isValid())        return QTextLine();    const QTextLayout *layout = block.layout();    if (!layout)        return QTextLine();    const int relativePos = cursor.position() - block.position();    return layout->lineForTextPosition(relativePos);}bool QTextEditPrivate::cursorMoveKeyEvent(QKeyEvent *e){    Q_Q(QTextEdit);    if (cursor.isNull())        return false;    QTextCursor::MoveMode mode = e->modifiers() & Qt::ShiftModifier                                   ? QTextCursor::KeepAnchor                                   : QTextCursor::MoveAnchor;    QTextCursor::MoveOperation op = QTextCursor::NoMove;#ifdef Q_WS_MAC    // There can be only one modifier (+ shift), but we also need to make sure    // that we have a "move key" pressed before we reject it.    bool twoModifiers        = ((e->modifiers() & (Qt::ControlModifier | Qt::AltModifier))           == (Qt::ControlModifier | Qt::AltModifier))        || ((e->modifiers() & (Qt::ControlModifier | Qt::MetaModifier))            == (Qt::ControlModifier | Qt::MetaModifier))        || ((e->modifiers() & (Qt::AltModifier | Qt::MetaModifier))            == (Qt::AltModifier | Qt::MetaModifier));#else    if (e->modifiers() & (Qt::AltModifier | Qt::MetaModifier | Qt::KeypadModifier)) {        e->ignore();        return false;    }#endif    switch (e->key()) {#ifndef Q_WS_MAC  // Use the default Windows bindings.        case Qt::Key_Up:            op = QTextCursor::Up;            break;        case Qt::Key_Down:            op = QTextCursor::Down;            if (mode == QTextCursor::KeepAnchor) {                QTextBlock block = cursor.block();                QTextLine line = currentTextLine(cursor);                if (!block.next().isValid()                    && line.isValid()                    && line.lineNumber() == block.layout()->lineCount() - 1)                    op = QTextCursor::End;            }            break;        case Qt::Key_Left:            op = e->modifiers() & Qt::ControlModifier                 ? QTextCursor::WordLeft                 : QTextCursor::Left;            break;        case Qt::Key_Right:            op = e->modifiers() & Qt::ControlModifier                 ? QTextCursor::WordRight                 : QTextCursor::Right;            break;        case Qt::Key_Home:            op = e->modifiers() & Qt::ControlModifier                 ? QTextCursor::Start                 : QTextCursor::StartOfLine;            break;        case Qt::Key_End:            op = e->modifiers() & Qt::ControlModifier                 ? QTextCursor::End                 : QTextCursor::EndOfLine;            break;#else// Except for pageup and pagedown, Mac OS X has very different behavior, we don't do it all, but// here's the breakdown:// Shift still works as an anchor, but only one of the other keys can be down Ctrl (Command),// Alt (Option), or Meta (Control).// Command/Control + Left/Right -- Move to left or right of the line//                 + Up/Down -- Move to top bottom of the file. (Control doesn't move the cursor)// Option + Left/Right -- Move one word Left/right.//        + Up/Down  -- Begin/End of Paragraph.// Home/End Top/Bottom of file. (usually don't move the cursor, but will select)        case Qt::Key_Up:            if (twoModifiers) {                QApplication::beep();                return true;            } else {                if (e->modifiers() & (Qt::ControlModifier | Qt::MetaModifier))                    op = QTextCursor::Start;                else if (e->modifiers() & Qt::AltModifier)                    op = QTextCursor::StartOfBlock;                else                    op = QTextCursor::Up;            }            break;        case Qt::Key_Down:            if (twoModifiers) {                QApplication::beep();                return true;            } else {                if (e->modifiers() & (Qt::ControlModifier | Qt::MetaModifier)) {                    op = QTextCursor::End;                } else if (e->modifiers() & Qt::AltModifier) {                    op = QTextCursor::EndOfBlock;                } else {                    op = QTextCursor::Down;                    if (mode == QTextCursor::KeepAnchor) {                        QTextBlock block = cursor.block();                        QTextLine line = currentTextLine(cursor);                        if (!block.next().isValid()                            && line.isValid()                            && line.lineNumber() == block.layout()->lineCount() - 1)                            op = QTextCursor::End;                    }                }            }            break;        case Qt::Key_Left:            if (twoModifiers) {                QApplication::beep();                return true;            } else {                if (e->modifiers() & (Qt::ControlModifier | Qt::MetaModifier))                    op = QTextCursor::StartOfLine;                else if (e->modifiers() & Qt::AltModifier)                    op = QTextCursor::WordLeft;                else                    op = QTextCursor::Left;            }            break;        case Qt::Key_Right:            if (twoModifiers) {                QApplication::beep();                return true;            } else {                if (e->modifiers() & (Qt::ControlModifier | Qt::MetaModifier))                    op = QTextCursor::EndOfLine;                else if (e->modifiers() & Qt::AltModifier)                    op = QTextCursor::WordRight;                else                    op = QTextCursor::Right;            }            break;        case Qt::Key_Home:            if (e->modifiers() & (Qt::ControlModifier | Qt::MetaModifier | Qt::AltModifier)) {                QApplication::beep();                return true;            } else {                op = QTextCursor::Start;            }            break;        case Qt::Key_End:            if (e->modifiers() & (Qt::ControlModifier | Qt::MetaModifier | Qt::AltModifier)) {                QApplication::beep();                return true;            } else {                op = QTextCursor::End;            }            break;#endif        case Qt::Key_PageDown:            pageDown(mode);            break;        case Qt::Key_PageUp:            pageUp(mode);            break;    default:        return false;    }    const bool moved = cursor.movePosition(op, mode);    q->ensureCursorVisible();    if (moved) {        emit q->cursorPositionChanged();        q->updateMicroFocus();    }#ifdef QT_KEYPAD_NAVIGATION    else if (QApplication::keypadNavigationEnabled()        && (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down)) {        return false;    }#endif    selectionChanged();    repaintSelection();    return true;}void QTextEditPrivate::updateCurrentCharFormat(){    Q_Q(QTextEdit);    QTextCharFormat fmt = cursor.charFormat();    if (fmt == lastCharFormat)        return;    lastCharFormat = fmt;    emit q->currentCharFormatChanged(fmt);#ifdef QT3_SUPPORT    // compat signals    emit q->currentFontChanged(fmt.font());    emit q->currentColorChanged(fmt.foreground().color());#endif    q->updateMicroFocus();}void QTextEditPrivate::indent(){    QTextBlockFormat blockFmt = cursor.blockFormat();    QTextList *list = cursor.currentList();    if (!list) {        QTextBlockFormat modifier;        modifier.setIndent(blockFmt.indent() + 1);        cursor.mergeBlockFormat(modifier);    } else {        QTextListFormat format = list->format();        format.setIndent(format.indent() + 1);        if (list->itemNumber(cursor.block()) == 1)            list->setFormat(format);        else            cursor.createList(format);    }}void QTextEditPrivate::outdent(){    QTextBlockFormat blockFmt = cursor.blockFormat();    QTextList *list = cursor.currentList();    if (!list) {        QTextBlockFormat modifier;        modifier.setIndent(blockFmt.indent() - 1);        cursor.mergeBlockFormat(modifier);    } else {        QTextListFormat listFmt = list->format();        listFmt.setIndent(listFmt.indent() - 1);        list->setFormat(listFmt);    }}void QTextEditPrivate::gotoNextTableCell(){    QTextTable *table = cursor.currentTable();    QTextTableCell cell = table->cellAt(cursor);    int newColumn = cell.column() + cell.columnSpan();    int newRow = cell.row();    if (newColumn >= table->columns()) {        newColumn = 0;        ++newRow;        if (newRow >= table->rows())            table->insertRows(table->rows(), 1);    }    cell = table->cellAt(newRow, newColumn);    cursor = cell.firstCursorPosition();}void QTextEditPrivate::gotoPreviousTableCell(){    QTextTable *table = cursor.currentTable();    QTextTableCell cell = table->cellAt(cursor);    int newColumn = cell.column() - 1;    int newRow = cell.row();    if (newColumn < 0) {        newColumn = table->columns() - 1;        --newRow;        if (newRow < 0)            return;    }    cell = table->cellAt(newRow, newColumn);    cursor = cell.firstCursorPosition();}void QTextEditPrivate::createAutoBulletList(){    cursor.beginEditBlock();    QTextBlockFormat blockFmt = cursor.blockFormat();    QTextListFormat listFmt;    listFmt.setStyle(QTextListFormat::ListDisc);    listFmt.setIndent(blockFmt.indent() + 1);    blockFmt.setIndent(0);    cursor.setBlockFormat(blockFmt);    cursor.createList(listFmt);    cursor.endEditBlock();}void QTextEditPrivate::init(const QString &html){    Q_Q(QTextEdit);    setContent(Qt::RichText, html);    hbar->setSingleStep(20);    vbar->setSingleStep(20);    viewport->setBackgroundRole(QPalette::Base);    q->setAcceptDrops(true);    q->setFocusPolicy(Qt::WheelFocus);    q->setAttribute(Qt::WA_KeyCompression);#ifndef QT_NO_CURSOR    viewport->setCursor(Qt::IBeamCursor);#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产在线观看| 欧美日韩一区中文字幕| 91伊人久久大香线蕉| 色综合天天综合网天天看片| 欧美三级视频在线观看| 精品久久久久一区| 中文字幕字幕中文在线中不卡视频| 一区二区三区四区高清精品免费观看| 亚洲国产裸拍裸体视频在线观看乱了| 视频一区二区欧美| 国产福利91精品一区二区三区| 91色视频在线| 日韩一区二区三区在线观看| 中文字幕欧美激情一区| 亚洲成a人在线观看| 国产一区二区精品久久| 色综合久久综合网97色综合 | 国产三级精品三级| 一区二区三区在线视频播放| 美女视频第一区二区三区免费观看网站 | 天堂va蜜桃一区二区三区| 韩国视频一区二区| 色婷婷综合久久久中文字幕| 日韩欧美高清dvd碟片| 国产欧美久久久精品影院| 亚洲国产欧美在线人成| 国产成人精品aa毛片| 欧美日韩久久久久久| 国产精品私人影院| 日本成人中文字幕| 91捆绑美女网站| 精品国产一区二区精华| 一卡二卡三卡日韩欧美| 国产成人在线网站| 欧美片在线播放| 自拍偷拍国产精品| 国产激情精品久久久第一区二区| 欧美日韩精品一区二区三区 | 94-欧美-setu| 久久综合成人精品亚洲另类欧美| 亚洲成年人网站在线观看| av在线一区二区| 精品福利一区二区三区| 婷婷激情综合网| 91日韩一区二区三区| 久久久国际精品| 日本不卡123| 欧美性色综合网| 一区在线观看视频| 国产成人午夜精品影院观看视频| 欧美一区二区高清| 亚洲综合精品自拍| 91香蕉国产在线观看软件| 国产亚洲一二三区| 国产一区二区三区精品视频 | 久久精品99国产国产精| 欧美日韩一二三| 亚洲美女视频在线| 99久精品国产| 中文字幕一区日韩精品欧美| 国产精品主播直播| 久久综合色一综合色88| 久久66热偷产精品| 欧美一区二区三区视频| 午夜精品一区二区三区电影天堂| 色婷婷综合中文久久一本| 国产精品国产三级国产aⅴ无密码| 精品一区二区三区日韩| 日韩欧美你懂的| 久久精品久久久精品美女| 4438x成人网最大色成网站| 亚洲一区二区三区四区的| 一本色道a无线码一区v| 亚洲色图在线视频| 91在线观看视频| 亚洲人成在线观看一区二区| av在线不卡网| 中文字幕在线一区免费| 99在线热播精品免费| 亚洲欧洲av色图| 色悠久久久久综合欧美99| 亚洲美女电影在线| 色94色欧美sute亚洲线路一久| 亚洲激情图片qvod| 欧美视频一区二区三区四区 | 99热在这里有精品免费| 国产精品乱码一区二三区小蝌蚪| 丁香婷婷综合色啪| 国产精品久久久久婷婷二区次| 99久久精品国产一区二区三区| 国产精品视频看| 日本高清视频一区二区| 亚洲国产毛片aaaaa无费看| 91麻豆精品国产综合久久久久久 | 日韩一区二区在线观看| 黄色小说综合网站| 国产日韩亚洲欧美综合| 91年精品国产| 亚洲第一狼人社区| 欧美一区二区三区不卡| 国内成人精品2018免费看| 国产欧美一区二区三区鸳鸯浴| 成人久久视频在线观看| 亚洲最新视频在线观看| 欧美日本一区二区三区四区| 久久精品72免费观看| 国产精品嫩草影院av蜜臀| 色又黄又爽网站www久久| 午夜精品久久久久久| 久久影院午夜片一区| 91原创在线视频| 秋霞电影网一区二区| 国产亚洲1区2区3区| 色综合久久久久综合体| 日韩—二三区免费观看av| 国产日韩影视精品| 在线一区二区三区| 久久99国产精品免费网站| 亚洲男人天堂av| 日韩欧美国产综合一区 | 亚洲日本va午夜在线电影| 欧美精选一区二区| 国产白丝精品91爽爽久久| 亚洲一本大道在线| 国产亚洲va综合人人澡精品 | 婷婷成人综合网| 中文文精品字幕一区二区| 欧美日韩精品免费观看视频| 国产精品一品视频| 亚洲va国产天堂va久久en| 久久久久久久久一| 欧美电影影音先锋| 不卡视频一二三| 蜜桃av一区二区在线观看| 中文字幕一区二| 日韩欧美中文字幕制服| 色偷偷成人一区二区三区91 | 国产女同互慰高潮91漫画| 欧美日韩在线一区二区| 风流少妇一区二区| 蜜桃av一区二区三区| 国产精品久久久久永久免费观看| 这里只有精品视频在线观看| aaa国产一区| 狠狠色狠狠色综合| 亚洲综合久久久| 中文字幕在线播放不卡一区| www成人在线观看| 91精品欧美一区二区三区综合在 | 国产婷婷色一区二区三区四区 | 亚洲一区在线视频观看| 久久亚洲捆绑美女| 欧美精品vⅰdeose4hd| 91麻豆国产香蕉久久精品| 国产麻豆成人传媒免费观看| 免费日本视频一区| 一区二区三区欧美| 国产精品灌醉下药二区| 337p日本欧洲亚洲大胆色噜噜| 欧美日韩在线不卡| 色哦色哦哦色天天综合| 国产成人8x视频一区二区| 久久草av在线| 成人精品一区二区三区四区| 毛片av一区二区| 视频一区国产视频| 婷婷丁香激情综合| 亚洲五码中文字幕| 亚洲免费av网站| 日韩一区在线看| 国产精品乱码一区二三区小蝌蚪| 久久精品视频网| 久久久亚洲精华液精华液精华液| 日韩天堂在线观看| 欧美一区二区三区四区在线观看| 欧美久久一二三四区| 欧美亚洲禁片免费| 欧美日韩中文精品| 欧美日韩中字一区| 欧美另类videos死尸| 777xxx欧美| 欧美一级黄色录像| 日韩欧美你懂的| 欧美成人一区二区| 精品国产免费久久 | 国产精品中文字幕欧美| 久久av老司机精品网站导航| 老汉av免费一区二区三区| 美女视频黄久久| 狠狠色综合色综合网络| 久久成人免费电影| 国内精品第一页| 福利一区在线观看| 91丨porny丨国产入口| 色婷婷一区二区| 欧美日韩欧美一区二区| 欧美日韩一区久久| 欧美一区二区视频在线观看2022| 日韩精品中文字幕在线一区| 精品国产精品网麻豆系列|