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

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

?? qtextbrowser.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************** $Id: qt/src/widgets/qtextbrowser.cpp   2.3.12   edited 2005-10-27 $**** Implementation of the QTextView class**** Created : 990101**** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.**** This file is part of the widgets module of the Qt GUI Toolkit.**** This file may be distributed under the terms of the Q Public License** as defined by Trolltech AS of Norway and appearing in the file** LICENSE.QPL included in the packaging of this file.**** This file may be distributed and/or modified under the terms of the** GNU General Public License version 2 as published by the Free Software** Foundation and appearing in the file LICENSE.GPL included in the** packaging of this file.**** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition** licenses may use this file in accordance with the Qt Commercial License** Agreement provided with the Software.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for**   information about Qt Commercial License Agreements.** See http://www.trolltech.com/qpl/ for QPL licensing information.** See http://www.trolltech.com/gpl/ for GPL licensing information.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#include "qtextbrowser.h"#ifndef QT_NO_TEXTBROWSER#include "../kernel/qrichtext_p.h"#include "qapplication.h"#include "qlayout.h"#include "qpainter.h"#include "qvaluestack.h"#include "stdio.h"#include "qfile.h"#include "qtextstream.h"#include "qlayout.h"#include "qbitmap.h"#include "qtimer.h"#include "qimage.h"#include "qsimplerichtext.h"#include "qdragobject.h"#include "qurl.h"#ifdef QT_KEYPAD_MODEextern bool qt_modalEditingEnabled;#endif/*!  \class QTextBrowser qtextbrowser.h  \brief A rich text  browser with simple navigation.  \ingroup advanced  \ingroup helpsystem  This class is the same as the QTextView it inherits, with the  addition that it provides basic navigation features to follow links  in hypertext documents that link to other rich text documents. While  QTextView only allows to set its contents with setText(),  QTextBrowser has an additional function setSource(), that makes it  possible to set documents by name. These names are looked up in the  text view's mime source factory. If a document name ends with an  anchor, for example "\c #anchor", the text browser will  automatically scroll accordingly ( using scrollToAnchor() ). When  the user clicks on a hyperlink, the browser will call setSource()  itself, with the link's \c href value as argument.  QTextBrowser doesn't provide actual Back and Forward buttons, but it  has backward() and forward() slots that implement the  functionality. The home() slots brings it back to its very first  document displayed.  By using QTextView::setMimeSourceFactory(), you can provide your own  subclass of QMimeSourceFactory. This makes it possible to access  data from anywhere you need to, may it be the network or a  database. See QMimeSourceFactory::data() for details.  If you intend to use the mime factory to read the data directly from  the file system, you may have to specify the encoding for the file  extension you are using. For example  \code  mimeSourceFactory()->setExtensionType("qml", "text/utf8");  \endcode  Otherwise, the factory will not be able to resolve the document names.  For simpler richt text use, see QLabel, QTextView or QSimpleRichText.  <img src=qtextbrowser-m.png> <img src=qtextbrowser-w.png>*/class QTextBrowserData{public:    QString searchPath;    QString buttonDown;    QString highlight;    QPoint lastClick;    QValueStack<QString> stack;    QValueStack<QString> forwardStack;    QString home;    QString curmain;    QString curmark;#ifdef QT_KEYPAD_MODE    QTextBrowserData()     {     }        QString curhref;    QtTriple curhrefstartpos;    QtTriple curhrefendpos;    QtTriple prevhrefstartpos;#endif};/*!  Constructs an empty QTextBrowser.*/QTextBrowser::QTextBrowser(QWidget *parent, const char *name)    : QTextView( parent, name ){    d = new QTextBrowserData;    viewport()->setMouseTracking( TRUE );//     viewport()->setAcceptDrops( TRUE );}/*!  Destructs the browser.*/QTextBrowser::~QTextBrowser(){    delete d;}/*!  Sets the text document with the given \a name to be displayed.  The  name is looked up in the mimeSourceFactory() of the browser.  In addition to the factory lookup, this functions also checks for  optional anchors and scrolls the document accordingly.  If the first tag in the document is \c &lt;qt \c type=detail&gt;, it is  displayed as a popup rather than as new document in the browser  window itself. Otherwise, the document is set normally via  setText(), with \a name as new context.  If you are using the filesystem access capabilities of the mime  source factory, you have to ensure that the factory knows about the  encoding of specified text files, otherwise no data will be  available. The default factory handles a couple of common file  extensions such as \c *.html and \c *.txt with reasonable defaults. See  QMimeSourceFactory::data() for details.*/void QTextBrowser::setSource(const QString& name){#ifndef QT_NO_CURSOR    if ( isVisible() )	qApp->setOverrideCursor( waitCursor );#endif    QString source = name;    QString mark;    int hash = name.find('#');    if ( hash != -1) {	source  = name.left( hash );	mark = name.mid( hash+1 );    }    if ( source.left(5) == "file:" )	source = source.mid(6);    QString url = mimeSourceFactory()->makeAbsolute( source, context() );    QString txt;    bool dosettext = FALSE;    if ( !source.isEmpty() && url != d->curmain ) {	const QMimeSource* m =		    mimeSourceFactory()->data( source, context() );	if ( !m ){	    qWarning("QTextBrowser: no mimesource for %s", source.latin1() );	}	else {	    if ( !QTextDrag::decode( m, txt ) ) {		qWarning("QTextBrowser: cannot decode %s", source.latin1() );	    }	} 	if ( isVisible() ) { 	    QString firstTag = txt.left( txt.find('>' )+1 ); 	    QRichText* tmp = new QRichText( firstTag, QApplication::font() ); 	    static QString s_type = QString::fromLatin1("type"); 	    static QString s_detail = QString::fromLatin1("detail");	    bool doReturn = FALSE; 	    if ( tmp->attributes().contains(s_type)		 && tmp->attributes()[s_type] == s_detail )		doReturn = TRUE;	    QTextFormatCollection* formats = tmp->formats;	    delete tmp;	    delete formats; //#### fix inheritance structure in rich text	    if ( doReturn ) { 		popupDetail( txt, d->lastClick );#ifndef QT_NO_CURSOR 		qApp->restoreOverrideCursor();#endif 		return; 	    } 	}	d->curmain = url;	dosettext = TRUE;    }    d->curmark = mark;    if ( !mark.isEmpty() ) {	url += "#";	url += mark;    }    if ( !d->home )	d->home = url;    if ( d->stack.isEmpty() || d->stack.top() != url) {	d->stack.push( url );    }    int stackCount = d->stack.count();    if ( d->stack.top() == url )	stackCount--;    emit backwardAvailable( stackCount > 0 );    stackCount = d->forwardStack.count();    if ( d->forwardStack.top() == url )	stackCount--;    emit forwardAvailable( stackCount > 0 );    if ( dosettext )	setText( txt, url );    if ( isVisible() && !mark.isEmpty() )	scrollToAnchor( mark );    else	setContentsPos( 0, 0 );#ifndef QT_NO_CURSOR    if ( isVisible() )	qApp->restoreOverrideCursor();#endif}/*!  Returns the source of the currently display document. If no document is displayed or  the source is unknown, a null string is returned.  \sa setSource() */QString QTextBrowser::source() const{    if ( d->stack.isEmpty() )	return QString::null;    else	return d->stack.top();}/*!  Sets the contents of the browser to \a text, and emits the  textChanged() signal.*/void QTextBrowser::setText( const QString& text, const QString& context ){#ifdef QT_KEYPAD_MODE    bool hadCurrent = d->curhref.length() > 0;    d->curhref = "";#endif    QTextView::setText( text, context );#ifdef QT_KEYPAD_MODE    // select anchor if it's visible    if( !selectNextPrevHref(TRUE) && hadCurrent ) 	// no anchor to scroll to and had one previously, so notify	emit highlighted( QString::null );#endif    emit textChanged();}/*!  \fn void QTextBrowser::backwardAvailable(bool available)  This signal is emitted when the availability of the backward()  changes.  It becomes available when the user navigates forward,  and unavailable when the user is at the home().*//*!  \fn void QTextBrowser::forwardAvailable(bool available)  This signal is emitted when the availability of the forward()  changes.  It becomes available after backward() is activated,  and unavailable when the user navigates or goes forward() to  the last navigated document.*//*!  \fn void QTextBrowser::highlighted (const QString &href)  This signal is emitted when the user has selected but not activated  a link in the document.  \a href is the value of the href tag  in the link.*//*!  \fn void QTextBrowser::textChanged()  This signal is emitted whenever the setText() changes the  contents (eg. because the user clicked on a link).*//*!  Changes the document displayed to be the previous document  in the list of documents build by navigating links.  \sa forward(), backwardAvailable()*/void QTextBrowser::backward(){    if ( d->stack.count() <= 1)	return;    d->forwardStack.push( d->stack.pop() );    setSource( d->stack.pop() );    emit forwardAvailable( TRUE );}/*!  Changes the document displayed to be the next document  in the list of documents build by navigating links.  \sa backward(), forwardAvailable()*/void QTextBrowser::forward(){    if ( d->forwardStack.isEmpty() )	return;    setSource( d->forwardStack.pop() );    emit forwardAvailable( !d->forwardStack.isEmpty() );}/*!  Changes the document displayed to be the first document the  browser displayed.*/void QTextBrowser::home(){    if (!d->home.isNull() )	setSource( d->home );}/*!  Add Backward and Forward on ALT-Left and ALT-Right respectively.*/void QTextBrowser::keyPressEvent( QKeyEvent * e ){#ifdef QT_KEYPAD_MODE    switch( e->key() ) {	case Key_Select:		if ( qt_modalEditingEnabled && !isModalEditing() ) {		    setModalEditing( TRUE );		    if ( containsAnchor() )			richText().setSelectedAnchor( d->curhref, 						    d->curhrefstartpos, d->curhrefendpos );		    return;		} else if ( !d->curhref.isEmpty() ) {		    setSource( d->curhref );		    return;		} else {		    richText().setSelectedAnchor( QString::null, 						QtTriple(), QtTriple() );		    if( qt_modalEditingEnabled ) setModalEditing( FALSE );		}	    break;	case Key_Back:	case Key_No:	    if ( qt_modalEditingEnabled && isModalEditing() ) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产丝袜在线精品| 色婷婷国产精品| 精品国产乱码久久久久久久| 青青草91视频| 久久夜色精品国产欧美乱极品| 精品一区二区三区免费| 国产视频一区二区在线| 成人国产精品视频| 中文字幕字幕中文在线中不卡视频| 色综合久久中文综合久久97| 亚洲尤物在线视频观看| 欧美日韩国产美女| 美日韩一区二区三区| 久久亚洲精精品中文字幕早川悠里| 国产成人午夜视频| 亚洲黄色片在线观看| 欧美亚洲一区二区在线| 久久99精品久久久久婷婷| 中文字幕第一区二区| 欧美亚洲高清一区| 免费成人在线观看| 国产蜜臀97一区二区三区| 色先锋久久av资源部| 偷窥国产亚洲免费视频| 国产欧美精品一区| 欧美日韩亚洲丝袜制服| 国产在线播放一区| 亚洲与欧洲av电影| 久久久久久免费网| jizzjizzjizz欧美| 免费av网站大全久久| 亚洲欧美综合另类在线卡通| 欧美日韩国产精选| eeuss鲁片一区二区三区| 婷婷久久综合九色综合伊人色| 国产午夜一区二区三区| 欧美伊人久久久久久久久影院| 美女网站色91| 成人欧美一区二区三区黑人麻豆| 3d成人h动漫网站入口| 99久久精品情趣| 精品伊人久久久久7777人| 亚洲男人的天堂在线观看| 日韩欧美一区二区不卡| 91久久香蕉国产日韩欧美9色| 日韩高清在线电影| 亚洲毛片av在线| 日本一区二区三区四区在线视频| 制服丝袜在线91| 91污在线观看| 波多野结衣一区二区三区| 日韩专区在线视频| 亚洲婷婷在线视频| 国产午夜三级一区二区三| 日韩欧美一区在线观看| 欧美日韩在线三级| 91激情五月电影| 99久久久无码国产精品| 国产精品一线二线三线精华| 男男成人高潮片免费网站| 亚洲国产精品尤物yw在线观看| 亚洲欧美一区二区三区极速播放 | 欧美一区二区三区免费在线看 | 日韩一级二级三级精品视频| 色婷婷av久久久久久久| 99久久免费国产| eeuss鲁片一区二区三区在线看| 国产精品一区二区男女羞羞无遮挡 | 国产性天天综合网| 久久久久久一级片| 久久网站最新地址| 精品国精品自拍自在线| 日韩欧美综合一区| 日韩精品一区二区三区视频播放| 88在线观看91蜜桃国自产| 欧美性videosxxxxx| 精品视频一区三区九区| 欧美中文字幕亚洲一区二区va在线 | 欧美国产精品专区| 亚洲国产精品国自产拍av| 久久精品这里都是精品| 国产婷婷精品av在线| 国产日韩av一区二区| 国产精品另类一区| 自拍偷在线精品自拍偷无码专区| 亚洲图片欧美激情| 亚洲图片欧美色图| 亚洲亚洲精品在线观看| 视频一区二区三区入口| 美女任你摸久久| 国产老妇另类xxxxx| 成人高清视频在线| 色诱视频网站一区| 欧美日韩国产成人在线免费| 日韩视频在线永久播放| 久久久久九九视频| 国产精品久久久久久久蜜臀| 亚洲靠逼com| 日韩精品国产精品| 精品中文字幕一区二区| 国产麻豆成人精品| 91影院在线免费观看| 欧美亚一区二区| 日韩欧美不卡在线观看视频| 国产欧美日韩精品一区| 亚洲女性喷水在线观看一区| 午夜电影网一区| 麻豆国产精品777777在线| 国产成人免费视频网站高清观看视频| av在线播放不卡| 911国产精品| 日本一区二区动态图| 国产精品久久久久久久久久免费看| 亚洲专区一二三| 国产一区二区三区免费观看| 在线免费观看日韩欧美| 久久久综合九色合综国产精品| 亚洲色图制服丝袜| 精品制服美女丁香| 日本精品一区二区三区高清| 精品99一区二区三区| 一区二区三区中文字幕| 国产一区二区三区精品欧美日韩一区二区三区 | www.久久久久久久久| 制服丝袜国产精品| 亚洲视频中文字幕| 国产真实乱对白精彩久久| 欧美艳星brazzers| 亚洲国产精品v| 日韩**一区毛片| 91视频在线看| 日本一区二区三区国色天香 | 欧美人与性动xxxx| 中文字幕av资源一区| 日韩在线一区二区| 91久久线看在观草草青青| 久久九九国产精品| 麻豆91精品91久久久的内涵| 色综合天天综合网天天看片| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 日韩欧美在线影院| 亚洲福中文字幕伊人影院| 成人黄页在线观看| 久久精品亚洲麻豆av一区二区| 天堂av在线一区| 色94色欧美sute亚洲线路一久| 国产人久久人人人人爽| 久久9热精品视频| 欧美日韩一区不卡| 亚洲日本电影在线| av不卡在线播放| 亚洲一级二级三级| 99综合电影在线视频| 国产校园另类小说区| 韩国av一区二区三区在线观看| 91精品视频网| 天天操天天综合网| 欧美日韩亚洲国产综合| 一区二区激情小说| 在线中文字幕一区| 亚洲一区二区三区四区五区中文 | 国产老肥熟一区二区三区| 日韩免费在线观看| 久久精品国产精品亚洲综合| 日韩一区二区在线免费观看| 日本网站在线观看一区二区三区| 欧美亚洲高清一区二区三区不卡| 亚洲综合在线第一页| 色婷婷国产精品综合在线观看| 亚洲精品一二三四区| 色婷婷亚洲精品| 亚洲午夜精品在线| 欧美日韩国产另类不卡| 日本va欧美va精品发布| 欧美一区二区三区成人| 美女看a上一区| 国产拍揄自揄精品视频麻豆| 成人av在线影院| 一区二区三区四区在线免费观看| 色婷婷综合久久久久中文| 亚洲国产aⅴ天堂久久| 欧美日韩大陆在线| 蜜臀精品久久久久久蜜臀| 久久久久国产精品人| 北岛玲一区二区三区四区| 一区二区三区国产精华| 欧美久久久影院| 国产综合色在线| 亚洲人成影院在线观看| 欧美日韩一区在线| 黄色资源网久久资源365| 国产精品视频yy9299一区| 91麻豆精品秘密| 五月天一区二区三区| 337p粉嫩大胆色噜噜噜噜亚洲| 丰满亚洲少妇av| 亚洲一区二区三区四区在线观看| 欧美一二区视频| 99re成人精品视频| 日本伊人午夜精品|