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

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

?? qlabel.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/************************************************************************ $Id: qt/src/widgets/qlabel.cpp   2.3.12   edited 2005-10-27 $**** Implementation of QLabel widget class**** Created : 941215**** 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 "qlabel.h"#ifndef QT_NO_LABEL#include "qbitmap.h"#include "qpainter.h"#include "qdrawutil.h"#include "qaccel.h"#include "qmovie.h"#include <ctype.h>#include "qimage.h"#include "qbitmap.h"#include "qapplication.h"#include "qsimplerichtext.h"#include "qstylesheet.h"#include "qlineedit.h"class QLabelPrivate{public:    QLabelPrivate()	:minimumWidth(0), img(0), pix(0)    {}    int minimumWidth; // for richtext    QImage* img; // for scaled contents    QPixmap* pix; // for scaled contents    bool shDirty;    QSize sh;    int fw;;};// BEING REVISED: aavit/*!  \class QLabel qlabel.h  \brief The QLabel widget provides a static information display  \ingroup basic  QLabel is used for displaying information in the form of text or  image to the user. No user interaction functionality is  provided. The visual appearance of the label can be configured in  various ways, and it can be used for specifying a focus accelerator  key for another widget.  A QLabel can contain any of the following content types:  <ul>  <li> A plain text: set by passing a QString to setText().  <li> A rich text: set by passing a QString that contains a rich text to setText().  <li> A pixmap: set by passing a QPixmap to setPixmap().  <li> A movie: set by passing a QMovie to setMovie().  <li> A number: set by passing an \e int or a \e double to setNum(), which converts the number to plain text.  <li> Nothing: The same as an empty plain text. This is the default. Set by clear().  </ul>  When the content is changed using any of these functions, any  previous content is cleared.  The look of a QLabel can be tuned in several ways. All the settings  of QFrame are available for specifying a widget frame. The  positioning of the content within the QLabel widget area can be  tuned with setAlignment() and setIndent().  For example, this code  sets up a sunken panel with a two-line text in the bottom right  corner (both lines being flush with the right side of the label):  \code    QLabel *label = new QLabel;    label->setFrameStyle( QFrame::Panel | QFrame::Sunken );    label->setText( "first line\nsecond line" );    label->setAlignment( AlignBottom | AlignRight );  \endcode  A QLabel is often used as a label for another, interactive  widget. For this use, QLabel provides a handy mechanism for adding  an accelerator key (see QAccel) that will set the keyboard focus to  the other widget (called the QLabel's "buddy"). Example:  \code     QLineEdit* phoneEdit = new QLineEdit( this, "phoneEdit" );     QLabel* phoneLabel = new QLabel( phoneEdit, "&Phone:", this, "phoneLabel" );  \endcode  In this example, keyboard focus is transferred to the label's buddy  (the QLineEdit) when the user presses <dfn>Alt-P.</dfn> You can also  use the setBuddy() function to accomplish the same.  <img src=qlabel-m.png> <img src=qlabel-w.png>  \sa QLineEdit, QTextView, QPixmap, QMovie,  <a href="guibooks.html#fowler">GUI Design Handbook: Label</a>*//*!  Constructs an empty label.  The \a parent, \a name and \a f arguments are passed to the QFrame  constructor.  \sa setAlignment(), setFrameStyle(), setIndent()*/QLabel::QLabel( QWidget *parent, const char *name, WFlags f )    : QFrame( parent, name, f | WMouseNoMask  ){    init();}/*!  Constructs a label with a text. The \a text is set with setText().  The \a parent, \a name and \a f arguments are passed to the QFrame  constructor.  \sa setText(), setAlignment(), setFrameStyle(), setIndent()*/QLabel::QLabel( const QString &text, QWidget *parent, const char *name,		WFlags f )	: QFrame( parent, name, f | WMouseNoMask  ){    init();    setText( text );}/*!  Constructs a label with a text and a buddy.  The \a text is set with setText(). The \a buddy is set with setBuddy().  The \a parent, \a name and \a f arguments are passed to the QFrame  constructor.  \sa setText(), setBuddy(), setAlignment(), setFrameStyle(),  setIndent()*/QLabel::QLabel( QWidget *buddy,  const QString &text,		QWidget *parent, const char *name, WFlags f )    : QFrame( parent, name, f | WMouseNoMask ){    init();#ifndef QT_NO_ACCEL    setBuddy( buddy );#else    if ( buddy )	setAlignment( alignment() | ShowPrefix );#endif    setText( text );}/*!  Destructs the label.*/QLabel::~QLabel(){    clearContents();    delete d;}void QLabel::init(){    lpixmap = 0;#ifndef QT_NO_MOVIE    lmovie = 0;#endif#ifndef QT_NO_ACCEL    lbuddy = 0;    accel = 0;#endif    lpixmap = 0;    align = AlignLeft | AlignVCenter | ExpandTabs;    extraMargin= -1;    autoresize = FALSE;    scaledcontents = FALSE;    textformat = Qt::AutoText;#ifndef QT_NO_RICHTEXT    doc = 0;#endif    setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );    d = new QLabelPrivate;    d->shDirty = TRUE;    d->fw = frameWidth();}/*!  \fn QString QLabel::text() const  Returns the label text. If the content is a plain or a rich text,  this is the string that was passed to setText(). Otherwise, it is an  empty/null string.  \sa setText(), setNum(), clear()*//*!  Sets the label contents to \a text, or does nothing if \a text is  equal to the current contents of the label. Any previous content is  cleared.  \a text will be interpreted either as a plain text or as a rich  text, depending on the text format setting; see setTextFormat(). The  default setting is \c AutoText, i.e. QLabel will try to auto-detect  the format of \a text.  If \a text is interpreted as a plain text, and a buddy has been set,  the buddy accelerator key is updated from the new text.  The label resizes itself if auto-resizing is enabled.  Note that Qlabel is well suited to display small rich text documents  only. For large documents, use QTextView instead. It will flicker  less on resize and can also provide a scrollbar if necessary.  \sa text(), setTextFormat(), setBuddy(), setAlignment()*/void QLabel::setText( const QString &text ){    if ( ltext == text )	return;    QSize osh = sizeHint();    clearContents();    ltext = text;#ifndef QT_NO_ACCEL    int p = QAccel::shortcutKey( ltext );    if ( p ) {	if ( !accel )	    accel = new QAccel( this, "accel label accel" );	accel->connectItem( accel->insertItem( p ),			    this, SLOT(acceleratorSlot()) );    }#endif#ifndef QT_NO_RICHTEXT    updateRichText();#endif    updateLabel( osh );}#ifndef QT_NO_RICHTEXTvoid QLabel::updateRichText(){    if ( textformat == RichText ||	 ( textformat == AutoText && QStyleSheet::mightBeRichText(ltext) ) ) {	delete doc;	doc = new QSimpleRichText( ltext, font() );	doc->setWidth( 10 );	d->minimumWidth = doc->widthUsed();    }}#endif/*!  Clears any label contents. Equivalent with setText( "" ).*/void QLabel::clear(){    setText( QString::fromLatin1("") );}/*!  \fn QPixmap *QLabel::pixmap() const  If the label contains a pixmap, returns a pointer to it. Otherwise,  returns 0.  \sa setPixmap()*//*!  Sets the label contents to \a pixmap. Any previous content is cleared.  The buddy accelerator, if any, is disabled.  The label resizes itself if auto-resizing is enabled.  \sa pixmap(), setBuddy()*/void QLabel::setPixmap( const QPixmap &pixmap ){    QSize osh = sizeHint();    if ( !lpixmap || lpixmap->serialNumber() != pixmap.serialNumber() ) {	clearContents();	lpixmap = new QPixmap( pixmap );    }    if ( lpixmap->depth() == 1 && !lpixmap->mask() )	lpixmap->setMask( *((QBitmap *)lpixmap) );    updateLabel( osh );}/*!  Sets the label contents to a plain text containing the printed value  of \a num. Does nothing if this is equal to the current contents of  the label. Any previous content is cleared.  The buddy accelerator, if any, is disabled.  The label resizes itself if auto-resizing is enabled.  \sa setText(), QString::setNum(), setBuddy()*/void QLabel::setNum( int num ){    QString str;    str.setNum( num );	setText( str );}/*!  Sets the label contents to a plain text containing the printed value  of \a num.  Does nothing if this is equal to the current contents of  the label. Any previous content is cleared.  The buddy accelerator, if any, is disabled.  The label resizes itself if auto-resizing is enabled.  \sa setText(), QString::setNum(), setBuddy()*/void QLabel::setNum( double num ){    QString str;    str.setNum( num );	setText( str );}/*!  \fn int QLabel::alignment() const  Returns the alignment setting.  \sa setAlignment()*//*!  Sets the alignment of the label contents.  The \a alignment must be a bitwise OR of Qt::AlignmentFlags  values. The \c WordBreak, \c ExpandTabs, \c SingleLine and \c  ShowPrefix flags apply only if the label contains a plain text, and  are otherwise ignored. The \c DontClip flag is always ignored.  If the label has a buddy, the \c ShowPrefix flag is forced to TRUE.  The default alignment is <code>AlignLeft | AlignVCenter |  ExpandTabs</code> if the label doesn't have a buddy and  <code>AlignLeft | AlignVCenter | ExpandTabs | ShowPrefix </code> if  the label has a buddy.  \sa Qt::AlignmentFlags, alignment(), setBuddy(), setText()*/void QLabel::setAlignment( int alignment ){    if ( alignment == align )	return;    QSize osh = sizeHint();#ifndef QT_NO_ACCEL    if ( lbuddy )	align = alignment | ShowPrefix;    else#endif	align = alignment;    updateLabel( osh );}/*!  \fn int QLabel::indent() const  Returns the indent of the label.  \sa setIndent()*//*!  Sets the indent of the label to \a indent pixels.  The indent applies to the left edge if alignment() is \c AlignLeft,  to the right edge if alignment() is \c AlignRight, to the top edge  if alignment() is \c AlignTop, and to to the bottom edge if  alignment() is \c AlignBottom.  If \a indent is negative, or if no indent has been set, the label  computes the effective indent as follows: If frameWidth() is 0, the  effective indent becomes 0. If frameWidth() is greater than 0, the  effective indent becomes half the width of the "x" character of the  widget's current font().  If \a indent is non-negative, the effective indent is \a indent  pixels.  \sa indent(), setAlignment(), frameWidth(), font()*/void QLabel::setIndent( int indent ){    extraMargin = indent;    updateLabel( QSize( -1, -1 ) );}/*!  \fn bool QLabel::autoResize() const  \obsolete  Returns TRUE if auto-resizing is enabled, or FALSE if auto-resizing  is disabled.  Auto-resizing is disabled by default.  \sa setAutoResize()*//*! \obsolete  Enables auto-resizing if \a enable is TRUE, or disables it if \a  enable is FALSE.  When auto-resizing is enabled, the label will resize itself to fit  the contents whenever the contents change. The top left corner is  not moved. This is useful for QLabel widgets that are not managed by  a QLayout (e.g. top-level widgets).  Auto-resizing is disabled by default.  \sa autoResize(), adjustSize(), sizeHint()*/void QLabel::setAutoResize( bool enable ){    if ( (bool)autoresize != enable ) {	autoresize = enable;	if ( autoresize )	    adjustSize();			// calls resize which repaints    }}/*!  Returns the size that will be used if the width of the label is  \a w. If \a w is -1, the sizeHint() is returned.*/QSize QLabel::sizeForWidth( int w ) const{    QFontMetrics fm = fontMetrics();    QRect br;    QPixmap *pix = pixmap();#ifndef QT_NO_MOVIE    QMovie *mov = movie();#endif    int fw = frameWidth();    int m  = 2*indent();    if ( m < 0 ) {	if ( fw > 0 )	    m = fm.width( 'x' );	else	    m = 0;    }    if ( pix ) {	br = pix->rect();    }#ifndef QT_NO_MOVIE    else if ( mov ) {	br = mov->framePixmap().rect();    }#endif#ifndef QT_NO_RICHTEXT    else if ( doc ) {	if ( w < 0 )	    doc->adjustSize();	else {	    w -= 2*fw + m;	    doc->setWidth( w );	}	br = QRect( 0, 0, doc->widthUsed(), doc->height() );    }    else#endif    {	bool tryWidth = (w < 0) && (align & WordBreak);	if ( tryWidth )	    w = fm.width( 'x' ) * 80;	else if ( w < 0 )	    w = 2000;	br = fm.boundingRect( 0, 0, w ,2000, alignment(), text() );	if ( tryWidth && br.height() < 4*fm.lineSpacing() && br.width() > w/2 )	    	br = fm.boundingRect( 0, 0, w/2, 2000, alignment(), text() );	if ( tryWidth && br.height() < 2*fm.lineSpacing() && br.width() > w/4 )	    br = fm.boundingRect( 0, 0, w/4, 2000, alignment(), text() );	// adjust so "Yes" and "yes" will have the same height	int h = fm.lineSpacing();	if ( h <= 0 ) // for broken fonts....	    h = 14;	br.setHeight( ((br.height() + h-1) / h)*h - fm.leading() );	if ( indent() > 0 ) {	    if ( (align & AlignLeft) || (align & AlignRight ) )		br.setWidth( br.width() + indent() );	    else if ( (align & AlignTop) || (align & AlignBottom ) )		br.setHeight( br.height() + indent() );	}    }    int wid = br.width() + m + 2*fw;    int hei = br.height() + m + 2*fw;    return QSize( wid, hei );}/*!  \reimp*/int QLabel::heightForWidth( int w ) const{#ifndef QT_NO_RICHTEXT    if ( doc || align & WordBreak )	return sizeForWidth( w ).height();#endif    return QWidget::heightForWidth( w );}/*!\reimp*/QSize QLabel::sizeHint() const{    //     Does not work well with the WordBreak flag; use    //    heightForWidth() in stead.    if (d->shDirty || d->fw != frameWidth()) {	d->sh = sizeForWidth( -1 );	d->fw = frameWidth();	d->shDirty = FALSE;    }    return d->sh;}/*!  \reimp*/QSize QLabel::minimumSizeHint() const{#ifndef QT_NO_RICHTEXT    if ( doc )	return QSize( d->minimumWidth, -1 );#endif    return QSize( -1, -1 );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区四区五区入口| 精品国产凹凸成av人导航| 国产揄拍国内精品对白| 久久99精品国产.久久久久久| 青草av.久久免费一区| 日本最新不卡在线| 日韩av午夜在线观看| 天天亚洲美女在线视频| 亚洲成人午夜电影| 午夜a成v人精品| 日韩不卡一二三区| 蜜桃av一区二区| 国产精一区二区三区| 不卡一区二区三区四区| 色综合天天综合网天天狠天天| 日本韩国一区二区| 欧美午夜精品一区二区三区| 欧美日韩一区二区三区四区五区 | 波多野结衣的一区二区三区| 99免费精品在线| 在线看国产一区二区| 777奇米四色成人影色区| 日韩亚洲欧美综合| 国产欧美日韩激情| 亚洲色图欧洲色图| 三级亚洲高清视频| 国产伦精品一区二区三区视频青涩 | 欧美性大战xxxxx久久久| 欧美性感一类影片在线播放| 日韩视频一区二区| 国产日本一区二区| 一区二区三区中文在线| 日韩高清在线一区| 国产成人在线观看| 91一区一区三区| 欧美一卡二卡三卡四卡| 欧美高清一级片在线观看| 亚洲永久免费av| 激情欧美日韩一区二区| 91在线精品一区二区三区| 欧美色手机在线观看| 欧美精品一区二区三区高清aⅴ| 欧美国产丝袜视频| 亚洲午夜日本在线观看| 精品一区二区国语对白| 色又黄又爽网站www久久| 日韩久久久久久| 亚洲欧洲中文日韩久久av乱码| 蜜臀av在线播放一区二区三区| 成人动漫在线一区| 91精品国产综合久久精品图片| 欧美国产欧美综合| 三级欧美在线一区| caoporn国产精品| 日韩免费福利电影在线观看| 国产精品不卡一区| 青青草精品视频| 色88888久久久久久影院野外| 26uuu成人网一区二区三区| 亚洲欧美激情视频在线观看一区二区三区| 天堂蜜桃91精品| 99re亚洲国产精品| 日韩精品一区二区三区四区| 亚洲欧美一区二区三区孕妇| 激情都市一区二区| 欧美日韩国产精品自在自线| 欧美韩国日本一区| 精品亚洲国产成人av制服丝袜| 在线观看亚洲一区| 亚洲国产精品成人久久综合一区| 日本大胆欧美人术艺术动态| www.成人在线| 久久久久久久久久久久电影| 麻豆一区二区在线| 欧美性一区二区| 亚洲视频一区二区免费在线观看| 国产伦精品一区二区三区免费迷| 欧美三级中文字幕在线观看| 亚洲欧美另类图片小说| 国模无码大尺度一区二区三区| 欧美精品乱码久久久久久按摩| 亚洲视频免费在线观看| 国产999精品久久久久久绿帽| 精品免费视频.| 日韩激情一区二区| 欧美日韩国产美女| 一区二区三区中文在线| av一二三不卡影片| 国产精品国产三级国产aⅴ无密码| 国产精品一二三在| 久久综合九色综合97婷婷| 麻豆一区二区99久久久久| 欧美一级一级性生活免费录像| 亚洲第一会所有码转帖| 欧洲一区在线观看| 亚洲女人的天堂| 在线视频欧美精品| 一区二区三区四区亚洲| 色综合色综合色综合色综合色综合 | 国产精品色婷婷久久58| 国产成人在线观看| 国产精品麻豆视频| av一区二区三区| 综合久久久久久| 一本久道中文字幕精品亚洲嫩 | 国产一区久久久| 欧美va日韩va| 精品一区二区日韩| 久久女同精品一区二区| 国产mv日韩mv欧美| 国产精品久久久久久久蜜臀| 99精品视频一区| 一区二区三区成人在线视频| 欧美视频在线观看一区| 日韩中文字幕一区二区三区| 91精品国产高清一区二区三区 | 91视频免费看| 夜夜嗨av一区二区三区中文字幕 | 日本韩国欧美国产| 亚洲午夜一二三区视频| 欧美精品1区2区| 狠狠v欧美v日韩v亚洲ⅴ| 久久久久久久久蜜桃| 成人动漫在线一区| 亚洲午夜精品久久久久久久久| 欧美视频完全免费看| 奇米精品一区二区三区在线观看一 | 日本一区二区在线不卡| 91在线观看免费视频| 亚洲成人动漫在线观看| 日韩三级电影网址| 粉嫩蜜臀av国产精品网站| 自拍偷在线精品自拍偷无码专区| 欧美一a一片一级一片| 日本欧美肥老太交大片| 欧美激情一区三区| 在线看不卡av| 韩国三级电影一区二区| 中文字幕在线观看一区二区| 欧美影院一区二区| 久久成人久久爱| 国产精品区一区二区三区| 欧美三级一区二区| 国内国产精品久久| 亚洲六月丁香色婷婷综合久久| 91精品国产91综合久久蜜臀| 成人美女在线观看| 亚洲成人av免费| 国产视频一区二区在线观看| 在线免费观看成人短视频| 久久国产精品99久久久久久老狼| 亚洲色图一区二区| 日韩一级二级三级精品视频| youjizz国产精品| 日韩电影免费在线观看网站| 国产精品乱码一区二三区小蝌蚪| 欧美日韩久久久一区| 成人综合婷婷国产精品久久蜜臀 | 91在线国内视频| 麻豆精品一区二区综合av| 亚洲图片另类小说| 欧美一区二区久久| 色av成人天堂桃色av| 韩国av一区二区三区四区 | av电影在线观看一区| 偷拍一区二区三区| 国产精品视频线看| 欧美xfplay| 在线观看91视频| 成人综合在线网站| 久久99久久久久| 亚洲国产你懂的| ...av二区三区久久精品| 精品日韩成人av| 欧美三级中文字幕| 91最新地址在线播放| 国产黑丝在线一区二区三区| 青青国产91久久久久久| 一区二区三区不卡在线观看 | 国产精品一区二区无线| 日韩av中文字幕一区二区三区| 亚洲欧美日韩国产中文在线| 久久久久97国产精华液好用吗| 欧美一区二区三区免费视频| 精品视频123区在线观看| 99久久久无码国产精品| 成人午夜视频福利| 国产一区二区三区视频在线播放| 偷拍亚洲欧洲综合| 亚洲国产一区二区在线播放| 亚洲靠逼com| 中文字幕在线视频一区| 国产日韩亚洲欧美综合| 精品久久久久一区二区国产| 欧美丰满高潮xxxx喷水动漫| 欧美日韩小视频| 欧美三区在线观看| 欧美日韩中文一区| 欧美视频日韩视频在线观看| 一本色道久久加勒比精品|