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

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

?? qpopupmenu.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
/****************************************************************************** $Id: qt/src/widgets/qpopupmenu.cpp   2.3.12   edited 2005-10-27 $**** Implementation of QPopupMenu class**** Created : 941128**** 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.************************************************************************/#define	 INCLUDE_MENUITEM_DEF#include "qpopupmenu.h"#ifndef QT_NO_POPUPMENU#include "qmenubar.h"#include "qaccel.h"#include "qpainter.h"#include "qdrawutil.h"#include "qapplication.h"#include "qbitmap.h"#include "qpixmapcache.h"#include "qtimer.h"#include "qwhatsthis.h"#include "qobjectlist.h"#include "qguardedptr.h"#include "qeffects_p.h"#include <ctype.h>//#define ANIMATED_POPUP//#define BLEND_POPUP// Motif style parametersstatic const int motifArrowHMargin	= 6;	// arrow horizontal marginstatic const int motifArrowVMargin	= 2;	// arrow vertical margin/*+-----------------------------|      PopupFrame|   +-------------------------|   |	   ItemFrame|   |	+---------------------|   |	||   |	|			   \|   |	|   ^	T E X T	  ^	    | ItemVMargin|   |	|   |		  |	   /|   |	      ItemHMargin|*/// used for internal communicationstatic QPopupMenu * syncMenu = 0;static int syncMenuId = 0;// Used to detect motion prior to mouse-releasestatic int motion;// used to provide ONE single-shot timerstatic QGuardedPtr<QTimer> *singleSingleShot = 0;static bool supressAboutToShow = FALSE;static void popupSubMenuLater( int msec, QPopupMenu * receiver ) {    if ( !singleSingleShot )	singleSingleShot = new QGuardedPtr<QTimer>;    if ( !(*singleSingleShot) )	(*singleSingleShot) = new QTimer( qApp, "popup submenu timer" );    (*singleSingleShot)->disconnect( SIGNAL(timeout()) );    QObject::connect( *singleSingleShot, SIGNAL(timeout()),		      receiver, SLOT(subMenuTimer()) );    (*singleSingleShot)->start( msec, TRUE );}static bool preventAnimation = FALSE;#ifdef QT_KEYPAD_MODEextern bool qt_modalEditingEnabled;#endif// NOT REVISED/*!  \class QPopupMenu qpopupmenu.h  \brief The QPopupMenu class provides a popup menu widget.  \ingroup application  \ingroup basic  A popup menu widget is a selection menu. It can be both, a pull-down  menu in a menu bar or a standalone context menu.  Pull-down menus  are shown by the menu bar when the user clicks on the respective  item or hits the specified shortcut key. Use QMenuBar::insertItem()  to insert a popup menu into a menu bar. Show a context menu either  asynchronously with popup() or synchronously with exec().  Technically, a popup menu consists of a list of menu items. You add  items with insertItem().  An item is either a string, a pixmap or a  custom item that provides its own drawing function (see  QCustomMenuItem). In addition, items can have an optional icon drawn  on the very left side and an accelerator key, like "Ctrl-X".  There are three kind of menu items: separators, those that perform  an action and those that show a submenu.  Separators are inserted  with insertSeparator(). For submenus, you pass a pointer to a  QPopupMenu in your call to insertItem().  All other items are  considered action items.  When inserting actions items, you usually specify a receiver and a  slot. The receiver will be notified whenever the item was  selected. In addition, QPopupMenu provides two signals activated()  and highlighted() that signal the identifier of the respective menu  item. Sometimes it is practical to connect several items to one  slot. To distinguish between them, specify a slot that takes an  integer argument and use setItemParameter() to associate a unique  value with each item.  You clear a popup menu with clear() and remove single items with  removeItem() or removeItemAt().  A popup menu can display check marks for certain items when enabled  with setCheckable(TRUE). You check or uncheck items with  setItemChecked().  Items are either enabled or disabled. You toggle their state with  setItemEnabled().  Just before a popup menu becomes visible, it  emits the aboutToShow() signal. You can use this signal to set the  correct enabled/disabled states of all menu items before the user  sees it. The corresponding aboutToHide() signal is emitted when the  menu hides again.  You can provide What's This? help for single menu items with  setWhatsThis(). See QWhatsThis for general information about this  kind of light-weight online help.  For ultimate flexibility, you can also add entire widgets as items  into a popup menu, for example a color selector.  A QPopupMenu can also provide a tear-off menu. A tear-off menu is a  "torn off" copy of a menu that lives in a separate window. This  makes it possible for the user to "tear off" frequently used menus  and position them in a convenient place on the screen. If you want  that functionality for a certain menu, insert a tear-off handle with  insertTearOffHandle(). When using tear-off menus, keep in mind that  the concept isn't typically used on MS-Windows, so users may not be  familiar with it. Consider using a QToolBar instead.  menu/menu.cpp is a typical example of QMenuBar and QPopupMenu use.  \important insertItem removeItem removeItemAt clear text pixmap iconSet  insertSeparator  changeItem whatsThis setWhatsThis accel setAccel setItemEnabled isItemEnabled  setItemChecked isItemChecked connectItem disconnectItem setItemParameter itemParameter  <img src=qpopmenu-m.png> <img src=qpopmenu-w.png>  \sa QMenuBar  <a href="guibooks.html#fowler">GUI Design Handbook: Menu, Drop-Down and  Pop-Up</a>*//*! \fn void QPopupMenu::aboutToShow()  This signal is emitted just before the popup menu is displayed.  You  can connect it to any slot that sets up the menu contents (e.g. to  ensure that the right items are enabled).  \sa aboutToHide(), setItemEnabled(), setItemChecked(), insertItem(), removeItem()*//*! \fn void QPopupMenu::aboutToHide()  This signal is emitted just before the popup menu is hidden after it  has been displayed.  \warning Do not open a widget in a slot connected to this signal.  \sa aboutToShow(), setItemEnabled(), setItemChecked(), insertItem(), removeItem()*//*****************************************************************************  QPopupMenu member functions *****************************************************************************/class QMenuDataData {    // attention: also defined in qmenudata.cpppublic:    QMenuDataData();    QGuardedPtr<QWidget> aWidget;    int aInt;};static QPopupMenu* active_popup_menu = 0;/*!  Constructs a popup menu with a parent and a widget name.  Although a popup menu is always a top level widget, if a parent is  passed, the popup menu will be deleted on destruction of that parent  (as with any other QObject).*/QPopupMenu::QPopupMenu( QWidget *parent, const char *name )    : QFrame( parent, name, WType_Popup  | WRepaintNoErase ){    isPopupMenu	  = TRUE;    parentMenu	  = 0;    selfItem	  = 0;#ifndef QT_NO_ACCEL    autoaccel	  = 0;    accelDisabled = FALSE;#endif    popupActive	  = -1;    snapToMouse	  = TRUE;    tab = 0;    checkable = 0;    tornOff = 0;    maxPMWidth = 0;    tab = 0;    ncols = 1;    setFrameStyle( QFrame::PopupPanel | QFrame::Raised );    style().polishPopupMenu( this );    setBackgroundMode( PaletteButton );    connectModalRecursionSafety = 0;    setFocusPolicy( StrongFocus );}/*!  Destructs the popup menu.*/QPopupMenu::~QPopupMenu(){    if ( syncMenu == this ) {	qApp->exit_loop();	syncMenu = 0;    }    delete (QWidget*) QMenuData::d->aWidget;  // tear-off menu    if ( parentMenu )	parentMenu->removePopup( this );	// remove from parent menu    preventAnimation = FALSE;}/*!  Updates the item with identity \a id.*/void QPopupMenu::updateItem( int id )		// update popup menu item{    updateRow( indexOf(id) );}/*!  Enables or disables display of check marks by the menu items.  Notice that checking is always enabled when in windows-style.  \sa isCheckable(), QMenuData::setItemChecked()*/void QPopupMenu::setCheckable( bool enable ){    if ( isCheckable() != enable ) {	checkable = enable;	badSize = TRUE;	if ( QMenuData::d->aWidget )	    ( (QPopupMenu*)(QWidget*)QMenuData::d->aWidget)->setCheckable( enable );    }}/*!  Returns whether display of check marks by the menu items is enabled.  \sa setCheckable(), QMenuData::setItemChecked()*/bool QPopupMenu::isCheckable() const{    return checkable;}void QPopupMenu::menuContentsChanged(){    badSize = TRUE;				// might change the size#ifndef QT_NO_ACCEL    updateAccel( 0 );#endif    if ( isVisible() ) {	if ( tornOff )	    return;	updateSize();	update();    }    QPopupMenu* p = (QPopupMenu*)(QWidget*)QMenuData::d->aWidget;    if ( p && p->isVisible() ) {	p->mitems->clear();	for ( QMenuItemListIt it( *mitems ); it.current(); ++it ) {	    if ( it.current()->id() != QMenuData::d->aInt && !it.current()->widget() )		p->mitems->append( it.current() );	}	p->updateSize();	p->update();    }}void QPopupMenu::menuStateChanged(){#ifndef QT_NO_ACCEL    updateAccel( 0 ); // ### when we have a good solution for the accel vs. focus widget problem, remove that. That is only a workaround#endif    updateSize();    update();    if ( QMenuData::d->aWidget )	QMenuData::d->aWidget->update();}void QPopupMenu::menuInsPopup( QPopupMenu *popup ){    popup->parentMenu = this;			// set parent menu    connect( popup, SIGNAL(activatedRedirect(int)),	     SLOT(subActivated(int)) );    connect( popup, SIGNAL(highlightedRedirect(int)),	     SLOT(subHighlighted(int)) );}void QPopupMenu::menuDelPopup( QPopupMenu *popup ){    popup->parentMenu = 0;    popup->disconnect( SIGNAL(activatedRedirect(int)), this,		       SLOT(subActivated(int)) );    popup->disconnect( SIGNAL(highlightedRedirect(int)), this,		       SLOT(subHighlighted(int)) );}void QPopupMenu::frameChanged(){    menuContentsChanged();}/*!  Opens the popup menu so that the item number \a indexAtPoint will be  at the specified \e global position \a pos.  To translate a widget's  local coordinates into global coordinates, use QWidget::mapToGlobal().  When positioning a popup with exec() or popup(), keep in mind that  you cannot rely on the popup menu's current size(). For performance  reasons, the popup adapts its size only when actually needed. So in  many cases, the size before and after the show is  different. Instead, use sizeHint(). It calculates the proper size  depending on the menu's current contents.*/void QPopupMenu::popup( const QPoint &pos, int indexAtPoint ){    if ( !isPopup() && isVisible() )	hide();    //avoid circularity    if ( isVisible() || !isEnabled() )	return;    if (parentMenu && parentMenu->actItem == -1){	//reuse	parentMenu->menuDelPopup( this );	parentMenu = 0;    }    // #### should move to QWidget - anything might need this functionality,    // #### since anything can have WType_Popup window flag.    QPoint mouse = QCursor::pos();    snapToMouse = snapToMouse && pos == mouse;    // have to emit here as a menu might be setup in a slot connected    // to aboutToShow which will change the size of the menu    bool s = supressAboutToShow;    supressAboutToShow = TRUE;    if ( !s) {	emit aboutToShow();	updateSize();    }    if ( mitems->count() == 0 )			// oops, empty	insertSeparator();			// Save Our Souls    if ( badSize )	updateSize();    QWidget *desktop = QApplication::desktop();    int sw = desktop->width();			// screen width    int sh = desktop->height();			// screen height    int sx = desktop->x();			// screen pos    int sy = desktop->y();    int x  = pos.x();    int y  = pos.y();    if ( indexAtPoint > 0 )			// don't subtract when < 0	y -= itemGeometry( indexAtPoint ).y();		// (would subtract 2 pixels!)    int w  = width();    int h  = height();    if ( snapToMouse ) {	if ( x+w > sw )	    x = mouse.x()-w;	if ( y+h > sh )	    y = mouse.y()-h;	if ( x < sx )	    x = mouse.x();	if ( y < sy )	    y = sy;    }    if ( x+w > sw )				// the complete widget must	x = sw - w;				//   be visible    if ( y+h > sh )	y = sh - h;    if ( x < sx )	x = sx;    if ( y < sy )	y = sy;    move( x, y );    motion=0;    actItem = -1;#ifndef QT_NO_EFFECTS    int hGuess = QEffects::RightScroll;    int vGuess = QEffects::DownScroll;# ifdef QT_KEYPAD_MODE // ### Effects really needs to be able to have a direction hint set    if ( parentWidget() && parentWidget()->isA("ContextMenu") )	vGuess = QEffects::UpScroll;    bool avoidScrollView = child(0, "QScrollView");# endif    if ( snapToMouse && ( x + w/2 < mouse.x() ) ||	( parentMenu && parentMenu->isPopupMenu &&	( x + w/2 < ((QPopupMenu*)parentMenu)->x() ) ) )	hGuess = QEffects::LeftScroll;    if ( snapToMouse && ( y + h/2 < mouse.y() )#ifndef QT_NO_MENUBAR	|| ( parentMenu && parentMenu->isMenuBar &&	( y + h/2 < ((QMenuBar*)parentMenu)->mapToGlobal( ((QMenuBar*)parentMenu)->pos() ).y() ) )#endif    )	vGuess = QEffects::UpScroll;#ifdef QT_KEYPAD_MODE    if ( avoidScrollView )	show();    else#endif    if ( QApplication::isEffectEnabled( UI_AnimateMenu ) &&	 preventAnimation == FALSE ) {	if ( QApplication::isEffectEnabled( UI_FadeMenu ) )	    qFadeEffect( this );	else if ( parentMenu )	    qScrollEffect( this, parentMenu->isPopupMenu ? hGuess : vGuess );	else# ifdef QT_KEYPAD_MODE //QT_KEYPAD_MODE	    qScrollEffect( this, vGuess, 300 );# else	    qScrollEffect( this, hGuess | vGuess );# endif    } else#endif    {	show();    }}/*!  \fn void QPopupMenu::activated( int id )  This signal is emitted when a menu item is selected; \a id is the id  of the selected item.  Normally, you will connect each menu item to a single slot using  QMenuData::insertItem(), but sometimes you will want to connect  several items to a single slot (most often if the user selects from  an array).  This signal is handy in such cases.  \sa highlighted(), QMenuData::insertItem()*//*!  \fn void QPopupMenu::highlighted( int id )  This signal is emitted when a menu item is highlighted; \a id is the  id of the highlighted item.  Normally, you will connect each menu item to a single slot using  QMenuData::insertItem(), but sometimes you will want to connect

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品久久久| 麻豆成人综合网| 91原创在线视频| 亚洲乱码国产乱码精品精的特点| 97精品国产露脸对白| 国产嫩草影院久久久久| 色综合久久88色综合天天6| 亚洲精品免费一二三区| 欧美一级理论片| 成年人网站91| 男女男精品视频| 毛片不卡一区二区| 精品国内二区三区| 国产一区二区三区免费| 久久精品一区二区| 色综合久久88色综合天天免费| 污片在线观看一区二区| 久久久久国产精品麻豆| 99在线精品观看| 日日摸夜夜添夜夜添亚洲女人| 国产欧美综合色| 国产亚洲美州欧州综合国| 亚洲精品中文字幕乱码三区| 日韩欧美电影在线| 99riav久久精品riav| 美女精品一区二区| 亚洲欧洲成人精品av97| 国产亚洲精品bt天堂精选| 国产成人在线电影| 五月激情丁香一区二区三区| 精品国产免费人成在线观看| 色拍拍在线精品视频8848| 午夜久久久久久| 国产高清无密码一区二区三区| www久久精品| 91视频91自| 久久色在线视频| 精品在线播放免费| 精品国产123| 国产精品77777| 国产精品青草综合久久久久99| 不卡电影免费在线播放一区| 国产精品家庭影院| 一本久道久久综合中文字幕| 亚洲二区在线视频| 欧美理论片在线| 免费在线观看一区| 欧美v国产在线一区二区三区| 国产在线观看一区二区| 国产欧美一区二区三区在线看蜜臀| 国产白丝网站精品污在线入口| 国产精品蜜臀av| 欧美亚洲一区三区| 人人精品人人爱| 国产清纯在线一区二区www| 99久久99久久精品免费看蜜桃| 亚洲美腿欧美偷拍| 这里只有精品电影| 国产一区二区电影| 亚洲色图制服丝袜| 91精品国产黑色紧身裤美女| 老司机免费视频一区二区三区| 91精品久久久久久久99蜜桃| 久久国产麻豆精品| 国产精品卡一卡二| 欧美性色综合网| 狠狠色狠狠色综合系列| 国产女同性恋一区二区| 在线观看日韩毛片| 日韩国产欧美在线视频| 国产精品麻豆视频| 欧美色欧美亚洲另类二区| 韩国欧美一区二区| 日韩毛片在线免费观看| 日韩一级片网址| 91免费版pro下载短视频| 青青草91视频| 一区二区三区在线播放| 久久精品夜色噜噜亚洲aⅴ| 欧美午夜精品久久久| 国产成人综合在线观看| 中文字幕一区二区三区精华液 | 青青草一区二区三区| www日韩大片| 欧美优质美女网站| 大陆成人av片| 美日韩一区二区三区| 综合久久综合久久| xnxx国产精品| 欧美一级视频精品观看| 91精彩视频在线| 国产黑丝在线一区二区三区| 免费人成精品欧美精品| 亚洲精品国产一区二区三区四区在线| 欧美精品一区二区三区久久久 | 午夜伦欧美伦电影理论片| 国产精品免费久久| 日韩三级免费观看| 91丝袜高跟美女视频| 国产精品一区专区| 奇米精品一区二区三区在线观看| 亚洲视频香蕉人妖| 国产精品视频一二三区| 久久久综合九色合综国产精品| 91麻豆精品国产91| 欧美在线看片a免费观看| 99视频一区二区三区| 懂色av中文字幕一区二区三区| 狠狠色狠狠色综合日日91app| 蜜桃久久av一区| 蜜臀精品久久久久久蜜臀| 日韩精品一级二级 | 国产激情一区二区三区| 另类调教123区| 五月天中文字幕一区二区| 一区二区三区精品视频在线| 亚洲视频精选在线| 亚洲精品精品亚洲| 亚洲一区二区三区四区五区黄| 亚洲激情图片一区| 亚洲伦理在线精品| 一区二区三国产精华液| 亚洲国产精品影院| 日韩国产精品大片| 久久99国产精品久久99| 黄色小说综合网站| 国产精品77777| 成人黄色一级视频| 91论坛在线播放| 欧美三级日韩三级国产三级| 欧美三区在线观看| 欧美一卡二卡三卡| 精品久久国产97色综合| 国产亚洲视频系列| 中文字幕日韩一区二区| 亚洲在线观看免费| 毛片av中文字幕一区二区| 国产精品乡下勾搭老头1| 成人97人人超碰人人99| 色999日韩国产欧美一区二区| 欧美日韩你懂得| 欧美成人r级一区二区三区| 国产欧美精品一区aⅴ影院| 亚洲人成在线观看一区二区| 日韩专区中文字幕一区二区| 久久国产综合精品| 成人av在线网站| 欧美日韩综合色| 亚洲免费观看高清完整版在线观看| 国产精品福利一区二区三区| 一区二区三区中文字幕在线观看| 性欧美疯狂xxxxbbbb| 精品一区二区三区视频| av资源网一区| 91精品国产综合久久久久久久| 久久九九久久九九| 亚洲午夜激情av| 国产一区二区三区四区在线观看| 色偷偷88欧美精品久久久| 日韩一区二区三区在线观看| 国产精品伦一区| 日本在线不卡视频一二三区| 成人黄色免费短视频| 69堂成人精品免费视频| 亚洲国产成人午夜在线一区| 日日夜夜精品视频免费| 99re这里只有精品6| 欧美大胆一级视频| 亚洲一线二线三线久久久| 国产成人精品一区二区三区网站观看| 精品视频免费在线| 国产精品久久久久久久久免费丝袜| 日日夜夜免费精品| 日本韩国欧美一区二区三区| 久久久另类综合| 免费视频一区二区| 欧美在线视频你懂得| 亚洲国产精品ⅴa在线观看| 蜜桃av噜噜一区二区三区小说| 北条麻妃一区二区三区| 欧美军同video69gay| 亚洲免费观看高清完整版在线观看| 国产伦精品一区二区三区在线观看| 欧美日韩精品一区二区三区四区 | 精品污污网站免费看| 中文字幕亚洲成人| 国产美女主播视频一区| 欧美一区二区私人影院日本| 亚洲一区中文在线| 在线视频国内自拍亚洲视频| 国产精品久久久久一区二区三区 | 卡一卡二国产精品| 精品视频在线看| 亚洲成人精品影院| 色香蕉成人二区免费| 一区二区三区在线观看欧美| 色综合久久88色综合天天免费| 国产精品久久久久婷婷二区次| 国产福利一区在线| 国产免费观看久久|