亚洲欧美第一页_禁久久精品乱码_粉嫩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精品一区二区三区 | 国产91高潮流白浆在线麻豆| av激情综合网| 精品国产乱码久久久久久闺蜜| 中文字幕在线不卡一区| 日韩国产一二三区| 99精品在线免费| 久久久久久久免费视频了| 午夜国产精品影院在线观看| 不卡一区二区中文字幕| 精品捆绑美女sm三区| 亚洲成人www| 一本一道波多野结衣一区二区| 日韩欧美中文字幕制服| 亚洲第一搞黄网站| 91久久精品国产91性色tv| 欧美—级在线免费片| 九九九久久久精品| 8x8x8国产精品| 午夜精品久久久久久久久久| 91色.com| 亚洲人成网站色在线观看| 国产91精品一区二区麻豆网站| 日韩精品一区二区三区在线播放 | 欧美三区免费完整视频在线观看| 国产精品系列在线| 国产精品888| 国产精品羞羞答答xxdd| 99久久99久久免费精品蜜臀| 国产日韩欧美制服另类| 国产精品亚洲人在线观看| 久久久99精品免费观看| 国产在线国偷精品产拍免费yy| 日韩一区二区三| 免费在线观看视频一区| 亚洲色图制服诱惑| 五月天亚洲婷婷| 欧美日韩视频第一区| 亚洲自拍偷拍欧美| 欧美日韩一区二区三区高清| 欧美一区二区在线观看| 亚洲福中文字幕伊人影院| 欧美伊人久久久久久久久影院 | 午夜av一区二区三区| 欧美三级日韩三级国产三级| 性做久久久久久| 久久国产生活片100| 亚洲精品一区二区三区香蕉| 国产精品18久久久久久vr| 国产日韩精品一区二区三区| 成人高清视频在线| 亚洲综合一区二区| 在线播放91灌醉迷j高跟美女| 欧美日韩国产精品成人| 日韩欧美中文字幕公布| 风间由美一区二区三区在线观看| 中文字幕在线一区| 欧美无乱码久久久免费午夜一区| 三级精品在线观看| 久久影音资源网| 日本精品视频一区二区三区| 日韩高清不卡在线| 欧美国产精品专区| 欧美中文字幕一区二区三区| 久久99国产精品免费网站| 国产亚洲va综合人人澡精品| 91电影在线观看| 久久99热国产| 精品视频资源站| 国产精品一区二区在线观看网站 | 91亚洲国产成人精品一区二区三 | 色乱码一区二区三区88| 日韩精品福利网| 日本精品裸体写真集在线观看| 亚洲图片一区二区| 久久人人97超碰com| 91浏览器在线视频| 久久爱www久久做| 亚洲精品写真福利| 精品美女一区二区| 欧美色综合影院| 成人午夜免费视频| 精品在线免费观看| 一区二区三区精品在线| 国产午夜精品理论片a级大结局| 日本欧美韩国一区三区| 国产精品国产三级国产| 亚洲精品一二三| 欧美视频精品在线| 成人激情动漫在线观看| 久久成人18免费观看| 亚洲高清在线精品| 亚洲欧美中日韩| 精品粉嫩超白一线天av| 欧美日韩国产高清一区| 99久久精品免费看| 粉嫩蜜臀av国产精品网站| 日本亚洲最大的色成网站www| 色噜噜久久综合| 亚洲精品中文在线| 欧洲生活片亚洲生活在线观看| 午夜精品久久久久久| 久久久九九九九| 一区二区三区四区在线免费观看| 蜜臀av性久久久久av蜜臀妖精| 国产一区二区三区久久久| 91麻豆精品久久久久蜜臀 | 一区二区三区欧美日| 国产精品乱人伦| 国产日本欧美一区二区| 久久久三级国产网站| 欧美va亚洲va| 精品国产免费人成在线观看| 日韩欧美www| 欧美videos大乳护士334| 欧美一级免费大片| 日韩久久免费av| 欧美成人精品二区三区99精品| 91精品国产综合久久久蜜臀图片| 欧美卡1卡2卡| 6080午夜不卡| 欧美成人精精品一区二区频| 日韩欧美一二区| 久久综合五月天婷婷伊人| 久久免费的精品国产v∧| 欧美日本一区二区三区四区| 91首页免费视频| 99久久国产综合精品女不卡| 国产一区二区女| 三级在线观看一区二区| 夜夜操天天操亚洲| 首页国产欧美久久| 亚洲大片精品永久免费| 亚洲综合小说图片| 色婷婷国产精品综合在线观看| 777xxx欧美| 欧美一区二区三区视频在线观看| 99精品久久99久久久久| 99国产精品99久久久久久| 国产成人高清视频| 91麻豆国产福利精品| 色妞www精品视频| 欧美视频一区二区三区在线观看 | 欧美丝袜自拍制服另类| 欧美视频中文字幕| 中文字幕在线播放不卡一区| 午夜精品福利一区二区三区av | 亚洲精品免费看| 欧美综合视频在线观看| 久久精品视频一区二区| 国产欧美一区二区精品性| 中文字幕在线观看一区二区| 亚洲国产欧美日韩另类综合| 极品少妇xxxx精品少妇| 91片黄在线观看| 日韩免费视频线观看| 国产精品色哟哟| 免费观看日韩电影| 91免费版在线| 日韩精品一区二区三区视频播放| 国产精品嫩草99a| 日本欧美一区二区在线观看| 成人爱爱电影网址| 欧美精品第1页| 亚洲日本青草视频在线怡红院| 天使萌一区二区三区免费观看| 国产成人午夜高潮毛片| 制服.丝袜.亚洲.中文.综合| 中文字幕av资源一区| 免费在线观看成人| 色综合久久88色综合天天免费| 久久久久久久久久久久久女国产乱| 夜夜嗨av一区二区三区| 国产久卡久卡久卡久卡视频精品| 欧美色视频在线| 最新不卡av在线| 国产高清无密码一区二区三区| 欧美一区二区三区四区视频| 一区二区高清在线| www.66久久| 欧美激情一区在线观看| 国产一区亚洲一区| 日韩一区二区三区在线视频| 亚洲成人你懂的| 一本色道亚洲精品aⅴ| 国产精品美日韩| 成人综合婷婷国产精品久久| 久久久久国产精品免费免费搜索| 日韩国产精品久久久| 欧美日韩国产区一| 亚洲一区二区在线免费看| 99久久伊人网影院| 国产精品区一区二区三区| 国产成a人无v码亚洲福利| 久久久亚洲国产美女国产盗摄| 久久国产精品区| 精品国产露脸精彩对白| 久久国产人妖系列| 国产午夜一区二区三区|