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

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

?? qtooltip.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************** $Id: qt/src/widgets/qtooltip.cpp   2.3.12   edited 2005-10-27 $**** Tool Tips (or Balloon Help) for any widget or rectangle**** 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 "qtooltip.h"#ifndef QT_NO_TOOLTIP#include "qlabel.h"#include "qptrdict.h"#include "qapplication.h"#include "qguardedptr.h"#include "qtimer.h"#include "qeffects_p.h"static bool globally_enabled = TRUE;// Magic value meaning an entire widget - if someone tries to insert a// tool tip on this part of a widget it will be interpreted as the// entire widget.static inline QRect entireWidget(){    return QRect( -QWIDGETSIZE_MAX, -QWIDGETSIZE_MAX,		  2*QWIDGETSIZE_MAX, 2*QWIDGETSIZE_MAX );}// Internal class - don't touchclass QTipLabel : public QLabel{    Q_OBJECTpublic:    QTipLabel(const QString& text) : QLabel( 0, "toolTipTip",			  WStyle_StaysOnTop +			  WStyle_Customize + WStyle_NoBorder + WStyle_Tool )    {	setMargin(1);	setIndent(0);	setAutoMask( FALSE );	setFrameStyle( QFrame::Plain | QFrame::Box );	setLineWidth( 1 );	setAlignment( AlignLeft | AlignTop );	polish();	setText(text);	adjustSize();    }};// Internal class - don't touchclass QTipManager : public QObject{    Q_OBJECTpublic:    QTipManager();   ~QTipManager();    struct Tip    {	QRect		rect;	QString		text;	QString	        groupText;	QToolTipGroup  *group;	QToolTip       *tip;	bool	        autoDelete;	QRect 		geometry;	Tip	       *next;    };    bool    eventFilter( QObject * o, QEvent * e );    void    add( const QRect &gm, QWidget *, const QRect &, const QString& ,		 QToolTipGroup *, const QString& , QToolTip *, bool );    void    add( QWidget *, const QRect &, const QString& ,		 QToolTipGroup *, const QString& , QToolTip *, bool );    void    remove( QWidget *, const QRect & );    void    remove( QWidget * );    void    removeFromGroup( QToolTipGroup * );    void    hideTipAndSleep();public slots:    void    hideTip();private slots:    void    labelDestroyed();    void    clientWidgetDestroyed();    void    showTip();    void    allowAnimation();private:    QTimer  wakeUp;    QTimer  fallAsleep;    QPtrDict<Tip> *tips;    QLabel *label;    QPoint pos;    QGuardedPtr<QWidget> widget;    Tip *currentTip;    Tip *previousTip;    bool preventAnimation;    bool isApplicationFilter;    QTimer *removeTimer;};// We have a global, internal QTipManager objectstatic QTipManager *tipManager	  = 0;static bool	    initializedTM = FALSE;static void cleanupTipManager(){    delete tipManager;    tipManager = 0;    initializedTM = FALSE;}static void initTipManager(){    if ( !tipManager ) {	tipManager = new QTipManager;	CHECK_PTR( tipManager );    }    if ( !initializedTM ) {	initializedTM = TRUE;	qAddPostRoutine( cleanupTipManager );    }}QTipManager::QTipManager()    : QObject( 0, "toolTipManager" ){    tips = new QPtrDict<QTipManager::Tip>( 313 );    currentTip = 0;    previousTip = 0;    label = 0;    preventAnimation = FALSE;    isApplicationFilter = FALSE;    connect( &wakeUp, SIGNAL(timeout()), SLOT(showTip()) );    connect( &fallAsleep, SIGNAL(timeout()), SLOT(hideTip()) );    removeTimer = new QTimer( this );}QTipManager::~QTipManager(){    if ( isApplicationFilter && !qApp->closingDown() ) {	qApp->setGlobalMouseTracking( FALSE );	qApp->removeEventFilter( tipManager );    }    if ( tips ) {	QPtrDictIterator<QTipManager::Tip> i( *tips );	QTipManager::Tip *t, *n;	void *k;	while( (t = i.current()) != 0 ) {	    k = i.currentKey();	    ++i;	    tips->take( k );	    while ( t ) {		n = t->next;		delete t;		t = n;	    }	}	delete tips;    }    delete label;}void QTipManager::add( const QRect &gm, QWidget *w,		       const QRect &r, const QString &s,		       QToolTipGroup *g, const QString& gs,		       QToolTip *tt, bool a ){    QTipManager::Tip *h = (*tips)[ w ];    QTipManager::Tip *t = new QTipManager::Tip;    t->next = h;    t->tip = tt;    t->autoDelete = a;    t->text = s;    t->rect = r;    t->groupText = gs;    t->group = g;    t->geometry = gm;    if ( h )	tips->take( w );    else	connect( w, SIGNAL(destroyed()), this, SLOT(clientWidgetDestroyed()) );    tips->insert( w, t );    if ( a && t->rect.contains( pos ) && (!g || g->enabled()) ) {	removeTimer->stop();	showTip();    }    if ( !isApplicationFilter && qApp ) {	isApplicationFilter = TRUE;	qApp->installEventFilter( tipManager );	qApp->setGlobalMouseTracking( TRUE );    }    if ( t->group ) {	disconnect( removeTimer, SIGNAL( timeout() ),		 t->group, SIGNAL( removeTip() ) );	connect( removeTimer, SIGNAL( timeout() ),		 t->group, SIGNAL( removeTip() ) );    }}void QTipManager::add( QWidget *w, const QRect &r, const QString &s,		       QToolTipGroup *g, const QString& gs,		       QToolTip *tt, bool a ){    add( QRect( -1, -1, -1, -1 ), w, r, s, g, gs, tt, a );}void QTipManager::remove( QWidget *w, const QRect & r ){    QTipManager::Tip *t = (*tips)[ w ];    if ( t == 0 )	return;    if ( t == currentTip )	hideTip();    if ( t == previousTip )	previousTip = 0;    if ( t->rect == r ) {	tips->take( w );	if ( t->next )	    tips->insert( w, t->next );	delete t;    } else {	while( t->next && t->next->rect != r )	    t = t->next;	if ( t->next ) {	    QTipManager::Tip *d = t->next;	    t->next = t->next->next;	    delete d;	}    }    if ( (*tips)[ w ] == 0 )	disconnect( w, SIGNAL(destroyed()), this, SLOT(clientWidgetDestroyed()) );#if 0 // not needed, leads sometimes to crashes    if ( tips->isEmpty() ) {	// the manager will be recreated if needed	delete tipManager;	tipManager = 0;    }#endif}/*!  The label was destroyed in the program cleanup phase.*/void QTipManager::labelDestroyed(){    label = 0;}/*!  Remove sender() from the tool tip data structures.*/void QTipManager::clientWidgetDestroyed(){    const QObject *s = sender();    if ( s )	remove( (QWidget*) s );}void QTipManager::remove( QWidget *w ){    QTipManager::Tip *t = (*tips)[ w ];    if ( t == 0 )	return;    tips->take( w );    QTipManager::Tip * d;    while ( t ) {	if ( t == currentTip )	    hideTip();	d = t->next;	delete t;	t = d;    }    disconnect( w, SIGNAL(destroyed()), this, SLOT(clientWidgetDestroyed()) );#if 0    if ( tips->isEmpty() ) {	delete tipManager;	tipManager = 0;    }#endif}void QTipManager::removeFromGroup( QToolTipGroup *g ){    QPtrDictIterator<QTipManager::Tip> i( *tips );    QTipManager::Tip *t;    while( (t = i.current()) != 0 ) {	++i;	while ( t ) {	    if ( t->group == g ) {		if ( t->group )		    disconnect( removeTimer, SIGNAL( timeout() ),				t->group, SIGNAL( removeTip() ) );		t->group = 0;	    }	    t = t->next;	}    }}bool QTipManager::eventFilter( QObject *obj, QEvent *e ){    // avoid dumping core in case of application madness, and return    // quickly for some common but irrelevant events    if ( !qApp || !qApp->activeWindow() ||	 !obj || !obj->isWidgetType() || // isWidgetType() catches most stuff	 !e ||	 e->type() == QEvent::Paint ||	 e->type() == QEvent::Timer ||	 e->type() == QEvent::SockAct ||	 !tips )	return FALSE;    QWidget *w = (QWidget *)obj;    if ( e->type() == QEvent::FocusOut || e->type() == QEvent::FocusIn ) {	// user moved focus somewhere - hide the tip and sleep	hideTipAndSleep();	return FALSE;    }    QTipManager::Tip *t = 0;    while( w && !t ) {	t = (*tips)[ w ];	if ( !t )	    w = w->isTopLevel() ? 0 : w->parentWidget();    }    if ( !t ) {	if ( ( e->type() >= QEvent::MouseButtonPress &&	       e->type() <= QEvent::FocusOut) || e->type() == QEvent::Leave )	    hideTip();	return FALSE;    }    // with that out of the way, let's get down to action    switch( e->type() ) {    case QEvent::MouseButtonPress:    case QEvent::MouseButtonRelease:    case QEvent::MouseButtonDblClick:    case QEvent::KeyPress:    case QEvent::KeyRelease:	// input - turn off tool tip mode	hideTipAndSleep();	break;    case QEvent::MouseMove:	{ // a whole scope just for one variable	    QMouseEvent * m = (QMouseEvent *)e;	    QPoint mousePos = w->mapFromGlobal( m->globalPos() );	    if ( currentTip && !currentTip->rect.contains( mousePos ) ) {		hideTip();		if ( m->state() == 0 )		    return FALSE;	    }	    wakeUp.stop();	    if ( m->state() == 0 &&		    mousePos.x() >= 0 && mousePos.x() < w->width() &&		    mousePos.y() >= 0 && mousePos.y() < w->height() ) {		if ( label && label->isVisible() ) {		    return FALSE;		} else {		    if ( fallAsleep.isActive() ) {			wakeUp.start( 1, TRUE );		    } else {			previousTip = 0;			wakeUp.start( 700, TRUE );		    }		    if ( t->group && t->group->ena &&			 !t->group->del && !t->groupText.isEmpty() ) {			removeTimer->stop();			emit t->group->showTip( t->groupText );		    }		}		widget = w;		pos = mousePos;		return FALSE;	    } else {		hideTip();	    }	}	break;    case QEvent::Leave:    case QEvent::Hide:    case QEvent::Destroy:	if ( w == widget )	    hideTip();	break;    default:	break;    }    return FALSE;}void QTipManager::showTip(){    if ( !widget || !globally_enabled )	return;    QTipManager::Tip *t = (*tips)[ widget ];    while ( t && !t->rect.contains( pos ) )	t = t->next;    if ( t == 0 )	return;    if (  t == currentTip )	return; // nothing to do    if ( t->tip ) {	t->tip->maybeTip( pos );	return;    }    if ( t->group && !t->group->ena )	return;    if ( label ) {	label->setText( t->text );	label->adjustSize();	if ( t->geometry != QRect( -1, -1, -1, -1 ) )	    label->resize( t->geometry.size() );    } else {	label = new QTipLabel(t->text);	if ( t->geometry != QRect( -1, -1, -1, -1 ) )	    label->resize( t->geometry.size() );	CHECK_PTR( label );	connect( label, SIGNAL(destroyed()), SLOT(labelDestroyed()) );    }    QPoint p;    if ( t->geometry == QRect( -1, -1, -1, -1 ) ) {	p = widget->mapToGlobal( pos ) + QPoint( 2, 16 );    } else {	p = widget->mapToGlobal( t->geometry.topLeft() );	label->setAlignment( WordBreak | AlignCenter );	int h = label->heightForWidth( t->geometry.width() - 4 );	label->resize( label->width(), h );    }    if ( p.x() + label->width() > QApplication::desktop()->width() )	p.setX( QApplication::desktop()->width() - label->width() );    if ( p.y() + label->height() > QApplication::desktop()->height() )	p.setY( p.y() - 20 - label->height() );    if ( label->text().length() ) {	label->move( p );#ifndef QT_NO_EFFECTS	if ( QApplication::isEffectEnabled( UI_AnimateTooltip ) == FALSE ||	     previousTip || preventAnimation )	    label->show();	else if ( QApplication::isEffectEnabled( UI_FadeTooltip ) )	    qFadeEffect( label );	else	    qScrollEffect( label );#else	label->show();#endif	label->raise();	fallAsleep.start( 10000, TRUE );    }    if ( t->group && t->group->del && !t->groupText.isEmpty() ) {	removeTimer->stop();	emit t->group->showTip( t->groupText );    }    currentTip = t;    previousTip = 0;}void QTipManager::hideTip(){    QTimer::singleShot( 250, this, SLOT(allowAnimation()) );    preventAnimation = TRUE;    if ( label && label->isVisible() ) {	label->hide();	fallAsleep.start( 2000, TRUE );	wakeUp.stop();	if ( currentTip && currentTip->group )	    removeTimer->start( 100, TRUE );    } else if ( wakeUp.isActive() ) {	wakeUp.stop();	if ( currentTip && currentTip->group &&	     !currentTip->group->del && !currentTip->groupText.isEmpty() )	    removeTimer->start( 100, TRUE );    }    previousTip = currentTip;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色图制服丝袜| 久久精品夜夜夜夜久久| 激情av综合网| 一区二区在线看| 精品国产乱码久久久久久影片| 成人黄色电影在线| 日韩高清国产一区在线| 亚洲欧洲成人自拍| 久久久久国产精品厨房| 欧美亚洲一区二区在线| 国产高清一区日本| 久久成人免费网站| 亚洲成人精品在线观看| 国产精品女同互慰在线看| 欧美电视剧在线观看完整版| 91小视频在线| 成人精品小蝌蚪| 麻豆传媒一区二区三区| 亚洲va韩国va欧美va精品| 中文字幕一区在线观看| 久久精品一区二区三区四区| 日韩欧美电影一二三| 欧美日韩日日骚| 色悠悠久久综合| av激情成人网| 国产aⅴ精品一区二区三区色成熟| 毛片av一区二区| 亚洲电影视频在线| 亚洲一区在线观看免费| 亚洲女同女同女同女同女同69| 久久亚洲精华国产精华液 | 久久久精品免费观看| 欧美精品自拍偷拍| 在线观看日韩电影| 色呦呦国产精品| 日本电影欧美片| 91久久奴性调教| 色综合久久久久久久久久久| 波波电影院一区二区三区| 成人一区二区三区视频| 国产成人免费视频| 国产一区二区三区高清播放| 麻豆精品视频在线观看免费| 美日韩一区二区| 久久er精品视频| 久久99久久久久久久久久久| 久久99精品国产.久久久久久| 久久99久国产精品黄毛片色诱| 男人的天堂亚洲一区| 日本成人在线网站| 加勒比av一区二区| 国产精品91xxx| www.色精品| 色天天综合色天天久久| 色综合天天综合网天天看片| 在线视频国产一区| 日韩一区二区在线观看视频播放| 日韩欧美精品在线| 久久精品视频在线看| 国产精品免费久久久久| 亚洲免费在线观看| 亚洲成a人片在线观看中文| 日本一道高清亚洲日美韩| 狠狠色狠狠色综合系列| 高清shemale亚洲人妖| 99麻豆久久久国产精品免费优播| 欧美亚洲国产bt| 日韩一区二区影院| 久久综合色8888| 亚洲欧洲一区二区三区| 亚洲成人一区二区| 国产福利一区二区三区在线视频| av午夜一区麻豆| 欧美一区二区三区四区视频| 久久久国产精品午夜一区ai换脸| 成人欧美一区二区三区白人 | 久久久国产精华| 亚洲免费观看高清在线观看| 午夜精品久久久久久久久久久| 另类小说一区二区三区| k8久久久一区二区三区| 777亚洲妇女| 国产精品免费视频观看| 午夜精品国产更新| 成人一区在线观看| 3atv在线一区二区三区| 日本一区二区三区久久久久久久久不 | 日韩精品一区二区三区在线| 国产精品欧美一区喷水| 亚洲成人av免费| 成人性生交大片免费看在线播放| 色综合色综合色综合| 日韩精品一区二区三区在线| 中文字幕一区二区三区在线不卡| 秋霞电影一区二区| 99国产精品久| 久久亚洲精品国产精品紫薇| 亚洲一卡二卡三卡四卡五卡| 国产精品18久久久久久久网站| 欧美在线观看禁18| 中文子幕无线码一区tr| 日本aⅴ精品一区二区三区| 一本到不卡免费一区二区| 精品粉嫩aⅴ一区二区三区四区| 亚洲日本在线视频观看| 国产一区二区三区最好精华液| 91官网在线观看| 中文字幕成人av| 久久99久久久久久久久久久| 欧美三级电影精品| 亚洲人成电影网站色mp4| 国产一区二区三区黄视频 | 国产一区二区三区免费观看| 欧美日韩精品欧美日韩精品| 中文字幕一区二区三区乱码在线| 六月丁香综合在线视频| 91精品视频网| 亚洲成a人v欧美综合天堂| 91香蕉视频mp4| 亚洲国产精品精华液ab| 国模一区二区三区白浆| 日韩精品中文字幕一区二区三区 | 在线观看免费视频综合| 欧美激情在线看| 国产精品一区二区免费不卡 | 亚洲欧美日韩中文播放 | 秋霞影院一区二区| 欧美理论在线播放| 午夜一区二区三区视频| 在线观看区一区二| 亚洲夂夂婷婷色拍ww47| 99热99精品| 一区二区三区不卡视频| 99精品久久免费看蜜臀剧情介绍| 国产亚洲美州欧州综合国| 国产综合色产在线精品| 精品久久久久香蕉网| 韩国精品免费视频| 欧美精品一区视频| 国产在线观看一区二区| 久久久久一区二区三区四区| 国产一区二区精品久久99| 秋霞电影网一区二区| 成人视屏免费看| 欧美激情艳妇裸体舞| 99精品欧美一区二区三区综合在线| 亚洲高清视频中文字幕| 免费成人性网站| 韩国女主播一区| bt7086福利一区国产| 色系网站成人免费| 欧美疯狂性受xxxxx喷水图片| 色噜噜偷拍精品综合在线| 日韩欧美精品三级| 精品久久一区二区三区| 中文字幕欧美日韩一区| 亚洲大型综合色站| 丰满放荡岳乱妇91ww| 欧美区一区二区三区| 久久先锋影音av鲁色资源网| 亚洲综合在线视频| 国产福利一区二区| 欧美日韩国产精选| 国产精品美女一区二区三区 | 日韩国产精品91| 国产91综合网| 91精品国产综合久久久久久久 | 欧美电影免费观看高清完整版在线观看| 久久婷婷成人综合色| 亚洲最新视频在线观看| 国产不卡在线视频| 日韩一区二区在线看| 亚洲已满18点击进入久久| 国产一区二区电影| 欧美二区乱c少妇| 最新成人av在线| 欧美在线观看一区| 美女网站色91| 欧美日韩国产一区二区三区地区| 亚洲综合小说图片| 欧美亚洲综合另类| 亚洲精品国产高清久久伦理二区| 精品午夜一区二区三区在线观看| 色综合色综合色综合色综合色综合| 一区二区久久久久| 久久综合九色综合欧美98| 久久精品国产精品亚洲综合| 欧美色中文字幕| 日韩av二区在线播放| 亚洲人精品午夜| 色呦呦日韩精品| 一区二区三区四区视频精品免费| 国产一区二区三区电影在线观看| 91精品国产欧美一区二区成人| 无吗不卡中文字幕| 日韩欧美一级二级| 色综合久久久久| 久久精品欧美一区二区三区不卡| 图片区日韩欧美亚洲| 色婷婷国产精品|