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

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

?? qradiobutton.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
字號:
/****************************************************************************** $Id: qt/src/widgets/qradiobutton.cpp   2.3.12   edited 2005-10-27 $**** Implementation of QRadioButton class**** Created : 940222**** 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 "qradiobutton.h"#ifndef QT_NO_RADIOBUTTON#include "qbuttongroup.h"#include "qpainter.h"#include "qdrawutil.h"#include "qpixmap.h"#include "qpixmapcache.h"#include "qbitmap.h"#include "qtextstream.h"#include "qapplication.h"// NOT REVISED/*!  \class QRadioButton qradiobutton.h  \brief The QRadioButton widget provides a radio button with a text label.  \ingroup basic  QRadioButton and QCheckBox are both option buttons. That is, they  can be switched on (checked) or off (unchecked). The classes differ  in how the choices for the user are restricted. Check-boxes define  "many of many" choices, while radio buttons provide a "one of many"  choice. In a group of radio buttons, only one button at a time can  be checked. If the user selects another button, the previously  selected button is switched off.  While it is technically possible to implement radio-behaviour with  check boxes and vice versa, it's strongly recommended to stick with  the well-known semantics. Otherwise your users would be pretty  confused.  The easiest way to implement a "one of many" choice, is to simply  stick the radio buttons into QButtonGroup.  Whenver a button is switched on or off, it emits the signal  toggled(). Connect to this signal if you want to trigger an action  each time the button changes state. Otherwise, use isChecked() to  query whether or not a particular button is selected.  <img src=qradiobt-m.png> <img src=qradiobt-w.png>  \important text, setText, text, pixmap, setPixmap, accel, setAccel,  isToggleButton, setDown, isDown, isOn, state, autoRepeat,  isExclusiveToggle, group, setAutoRepeat, toggle, pressed, released,  clicked, toggled, state stateChanged  \sa QPushButton QToolButton  <a href="guibooks.html#fowler">GUI Design Handbook: Radio Button</a>*/static const int gutter = 6; // between button and textstatic const int margin = 2; // to right of text/*!  Constructs a radio button with no text.  The \e parent and \e name arguments are sent to the QWidget constructor.*/QRadioButton::QRadioButton( QWidget *parent, const char *name )	: QButton( parent, name, WRepaintNoErase | WResizeNoErase | WMouseNoMask ){    init();}/*!  Constructs a radio button with a text.  The \e parent and \e name arguments are sent to the QWidget constructor.*/QRadioButton::QRadioButton( const QString &text, QWidget *parent,			    const char *name )	: QButton( parent, name, WRepaintNoErase | WResizeNoErase | WMouseNoMask ){    init();    setText( text );}/*!  Initializes the radio button.*/void QRadioButton::init(){    setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) );    setToggleButton( TRUE );#ifndef QT_NO_BUTTONGROUP    if ( parentWidget() && parentWidget()->inherits("QButtonGroup") ) {	QButtonGroup *bgrp = (QButtonGroup *)parentWidget();	bgrp->setRadioButtonExclusive( TRUE );    }#endif}/*!  \fn bool QRadioButton::isChecked() const  Returns TRUE if the radio button is checked, or FALSE if it is not checked.  \sa setChecked()*//*!  Checks the radio button if \e check is TRUE, or unchecks it if \e check  is FALSE.  Calling this function does not affect other radio buttons unless a radio  button group has been defined using the QButtonGroup widget.  \sa isChecked()*/void QRadioButton::setChecked( bool check ){    setOn( check );}/*!\reimp*/QSize QRadioButton::sizeHint() const{    // Any more complex, and we will use style().itemRect()    // NB: QCheckBox::sizeHint() is similar    constPolish();    QSize sz;    if (pixmap())	sz = pixmap()->size();    else	sz = fontMetrics().size( ShowPrefix, text() );    QSize bmsz = style().exclusiveIndicatorSize();    if ( sz.height() < bmsz.height() )	sz.setHeight( bmsz.height() );    return (sz + QSize( bmsz.width()			+ (text().isEmpty() ? 0 : gutter+margin),			4 )).expandedTo( QApplication::globalStrut() );}/*!\reimp*/QSizePolicy QRadioButton::sizePolicy() const{    //### removeme 3.0    return QWidget::sizePolicy();}/*!\reimp*/bool QRadioButton::hitButton( const QPoint &pos ) const{    return rect().contains( pos );}/*!\reimp*/void QRadioButton::drawButton( QPainter *paint ){    QPainter	*p = paint;    const QColorGroup & g = colorGroup();    int		 x, y;    QFontMetrics fm = fontMetrics();    QSize lsz = fm.size(ShowPrefix, text());    QSize sz = style().exclusiveIndicatorSize();    // ### Why, off by one error???//    x = text().isEmpty() ? 1 : 0;    x = 0;    y = (height() - lsz.height() + fm.height() - sz.height())/2;#ifndef QT_NO_TEXTSTREAM#define SAVE_RADIOBUTTON_PIXMAPS#endif#if defined(SAVE_RADIOBUTTON_PIXMAPS)    QString pmkey;				// pixmap key    int kf = 0;    if ( isDown() )	kf |= 1;    if ( isOn() )	kf |= 2;    if ( isEnabled() )	kf |= 4;    QTextOStream os(&pmkey);    os << "$qt_radio_" << style().className() << "_"			 << palette().serialNumber() << "_" << kf;    QPixmap *pm = QPixmapCache::find( pmkey );    if ( pm ) {					// pixmap exists	drawButtonLabel( p );	p->drawPixmap( x, y, *pm );	return;    }    bool use_pm = TRUE;    QPainter pmpaint;    int wx, wy;    if ( use_pm ) {	pm = new QPixmap( sz );			// create new pixmap	CHECK_PTR( pm );	pmpaint.begin( pm );	p = &pmpaint;				// draw in pixmap	wx=x;  wy=y;				// save x,y coords	x = y = 0;	p->setBackgroundColor( g.background() );    }#endif#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2)    style().drawExclusiveIndicator(p, x, y, sz.width(), sz.height(), g, isOn(), isDown(), isEnabled() );#if defined(SAVE_RADIOBUTTON_PIXMAPS)    if ( use_pm ) {	pmpaint.end();	if ( backgroundPixmap() || backgroundMode() == X11ParentRelative ) {	    QBitmap bm( pm->size() );	    bm.fill( color0 );	    pmpaint.begin( &bm );	    style().drawExclusiveIndicatorMask( &pmpaint, 0, 0, bm.width(), bm.height(), isOn() );	    pmpaint.end();	    pm->setMask( bm );	}	p = paint;				// draw in default device	p->drawPixmap( wx, wy, *pm );	if (!QPixmapCache::insert(pmkey, pm) )	// save in cache	    delete pm;    }#endif    drawButtonLabel( p );}/*!\reimp*/void QRadioButton::drawButtonLabel( QPainter *p ){    int x, y, w, h;    GUIStyle gs = style();    QSize sz = style().exclusiveIndicatorSize();    if ( gs == WindowsStyle )	sz.setWidth(sz.width()+1);    y = 0;    x = sz.width() + gutter;    w = width() - x;    h = height();    style().drawItem( p, x, y, w, h,		      AlignLeft|AlignVCenter|ShowPrefix,		      colorGroup(), isEnabled(),		      pixmap(), text() );    if ( hasFocus() ) {	QRect br = style().itemRect( p, x, y, w, h,				     AlignLeft|AlignVCenter|ShowPrefix,				     isEnabled(),				     pixmap(), text() );	br.setLeft( br.left()-3 );	br.setRight( br.right()+2 );	br.setTop( br.top()-2 );	br.setBottom( br.bottom()+2);	br = br.intersect( QRect(0,0,width(),height()) );	if ( !text().isEmpty() )	    style().drawFocusRect( p, br, colorGroup() );	else {	    br.setRight( br.left()-1 );	    br.setLeft( br.left()-16 );	    br.setTop( br.top() );	    br.setBottom( br.bottom() );	    style().drawFocusRect( p, br, colorGroup() );	}    }}/*!  \reimp*/void QRadioButton::resizeEvent( QResizeEvent* e ){    QButton::resizeEvent(e);    int x, w, h;    GUIStyle gs = style();    QSize sz = style().exclusiveIndicatorSize();    if ( gs == WindowsStyle )	sz.setWidth(sz.width()+1);    x = sz.width() + gutter;    w = width() - x;    h = height();    if (isVisible()) {	QPainter p(this);	QRect br = style().itemRect( &p, x, 0, w, h,		AlignLeft|AlignVCenter|ShowPrefix,		isEnabled(),		pixmap(), text() );	update( br.right(), w, 0, h );    }    if ( autoMask() )	updateMask();}/*!\reimp */void QRadioButton::updateMask(){    QBitmap bm(width(),height());    {	bm.fill(color0);	QPainter p( &bm, this );	int x, y, w, h;	GUIStyle gs = style();	QFontMetrics fm = fontMetrics();	QSize lsz = fm.size(ShowPrefix, text());	QSize sz = style().exclusiveIndicatorSize();	if ( gs == WindowsStyle )	    sz.setWidth(sz.width()+1);	y = 0;	x = sz.width() + gutter;	w = width() - x;	h = height();	QColorGroup cg(color1,color1, color1,color1,color1,color1,color1,color1, color0);	style().drawItem( &p, x, y, w, h,			  AlignLeft|AlignVCenter|ShowPrefix,			  cg, TRUE,			  pixmap(), text() );	x = 0;	y = (height() - lsz.height() + fm.height() - sz.height())/2;	style().drawExclusiveIndicatorMask(&p, x, y, sz.width(), sz.height(), isOn() );	if ( hasFocus() ) { 	    y = 0; 	    x = sz.width() + gutter; 	    w = width() - x; 	    h = height();	    QRect br = style().itemRect( &p, x, y, w, h,					 AlignLeft|AlignVCenter|ShowPrefix,					 isEnabled(),					 pixmap(), text() );	    br.setLeft( br.left()-3 );	    br.setRight( br.right()+2 );	    br.setTop( br.top()-2 );	    br.setBottom( br.bottom()+2);	    br = br.intersect( QRect(0,0,width(),height()) );	    if ( !text().isEmpty() )		style().drawFocusRect( &p, br, cg );	    else {		br.setRight( br.left()-1 );		br.setLeft( br.left()-16 );		br.setTop( br.top() );		br.setBottom( br.bottom() );		style().drawFocusRect( &p, br, cg );	    }	}    }    setMask(bm);}/*! \reimp */void QRadioButton::focusInEvent( QFocusEvent *e  ){    QButton::focusInEvent( e ); // ### 3.0 remove}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产色综合久久不卡电影| 欧美自拍偷拍午夜视频| 亚洲激情av在线| 国产免费久久精品| 精品国精品国产| 91精品欧美综合在线观看最新 | 六月丁香婷婷久久| 国产欧美日韩综合| 欧美tk—视频vk| 欧美三级三级三级| 欧美亚男人的天堂| 91亚洲男人天堂| 国产精品一区二区在线观看不卡 | 亚洲成人免费av| 日韩一区欧美一区| 国产欧美日韩三区| 欧美韩国日本不卡| 1000部国产精品成人观看| 国产欧美视频一区二区| 国产网红主播福利一区二区| 国产午夜精品福利| 国产精品丝袜久久久久久app| 在线亚洲免费视频| 丰满岳乱妇一区二区三区| 欧美一区二区三区电影| 日韩亚洲欧美在线观看| 久久综合九色综合久久久精品综合 | 国产日韩亚洲欧美综合| 午夜欧美大尺度福利影院在线看| 国产aⅴ综合色| 中文字幕一区在线观看| 高清在线成人网| 久久老女人爱爱| 免费不卡在线观看| 日韩精品一区二区三区视频| 亚洲va中文字幕| 欧美高清一级片在线| 视频一区二区三区在线| 制服丝袜av成人在线看| 韩国理伦片一区二区三区在线播放| 欧美人体做爰大胆视频| 国内精品久久久久影院色| 国产亚洲成aⅴ人片在线观看| av高清不卡在线| 亚洲成a人片在线不卡一二三区 | 91视频国产资源| 婷婷六月综合网| 日本一二三不卡| 91免费小视频| 成人一区在线观看| 美女mm1313爽爽久久久蜜臀| 国产精品久久久久久亚洲毛片| 欧美日韩国产a| 色婷婷久久99综合精品jk白丝| 性做久久久久久久久| 一区二区三区在线观看网站| 日本一区二区三区高清不卡| 欧美男生操女生| 91成人国产精品| 91在线视频观看| 99国产一区二区三精品乱码| 国产黄色精品网站| 日日骚欧美日韩| 99视频一区二区| 久久精品国产999大香线蕉| 国产欧美一区二区三区网站| 91高清视频免费看| 一区二区视频免费在线观看| 欧美一级在线免费| 欧美日韩在线播| 久久精品国产成人一区二区三区| 亚洲免费在线视频一区 二区| 欧美xxxx老人做受| 欧美日韩一区中文字幕| 粉嫩av一区二区三区在线播放| 亚洲国产精品久久人人爱| 国产欧美日韩不卡| 国产精品女人毛片| 国产精品久久一级| 91国产视频在线观看| 在线亚洲高清视频| 在线观看亚洲a| 欧美系列日韩一区| 欧美日韩国产经典色站一区二区三区| 国产高清不卡一区二区| 国产米奇在线777精品观看| 精品一区二区三区免费视频| 国产精品白丝在线| 一区精品在线播放| 一区二区免费视频| 香蕉久久夜色精品国产使用方法 | 日韩精品资源二区在线| 日韩美女一区二区三区四区| 日韩免费性生活视频播放| 欧美成人国产一区二区| 国产三级三级三级精品8ⅰ区| 国产精品久久久久久久久免费相片 | 久久久亚洲国产美女国产盗摄 | 日韩电影在线观看一区| 国产欧美精品一区| 日产欧产美韩系列久久99| 国产精品一二三四区| 日本精品视频一区二区三区| 欧美久久婷婷综合色| 久久久www免费人成精品| 99久久er热在这里只有精品66| 毛片一区二区三区| 99精品黄色片免费大全| 欧美一级高清片| 国产女主播一区| 性做久久久久久免费观看| 国产在线看一区| 欧美日韩亚洲综合在线| 国产精品乱码一区二三区小蝌蚪| 亚洲一区二区3| 国产精品一区二区91| 日韩精品一区二区三区在线 | 欧美日韩色综合| 中文字幕视频一区二区三区久| 亚洲va欧美va人人爽| 丁香桃色午夜亚洲一区二区三区 | 久久精品夜夜夜夜久久| 免费成人你懂的| 欧美性猛交一区二区三区精品 | 欧美国产一区二区| 国产91精品一区二区麻豆亚洲| 欧美视频在线一区二区三区| 亚洲欧洲另类国产综合| 91丨porny丨户外露出| 亚洲综合999| 欧美人牲a欧美精品| 乱一区二区av| 国产亚洲精品久| 国产福利精品一区二区| 国产日产欧美一区二区视频| 一区二区三区精品视频在线| 69精品人人人人| 国产精品一二三四区| 中文字幕一区在线观看| 欧美色视频在线观看| 亚洲免费观看在线视频| 日韩一区二区三区视频| 丁香激情综合国产| 亚洲一区av在线| 欧美日韩精品专区| 亚洲另类在线制服丝袜| 欧美一区二区三区在线观看| fc2成人免费人成在线观看播放 | 成人高清免费观看| 精品一区二区久久久| 国产精品伦理在线| 久久综合av免费| 日韩亚洲欧美成人一区| 欧美午夜寂寞影院| 一区二区三区国产精华| 国产欧美视频一区二区| 欧美一卡2卡3卡4卡| 国产一区二区不卡| 激情综合色综合久久综合| 亚洲视频在线一区| 欧美一区二区在线播放| 欧美一区二区女人| 3751色影院一区二区三区| 九色综合国产一区二区三区| 日韩精品一二三四| 91麻豆精品国产91久久久| 一本大道久久a久久综合婷婷| 777亚洲妇女| 亚洲一区二区四区蜜桃| 成人妖精视频yjsp地址| 制服.丝袜.亚洲.中文.综合| 亚洲特黄一级片| 国产成人av影院| 久久九九影视网| 麻豆免费看一区二区三区| 日本道精品一区二区三区| 中文字幕一区二区不卡 | 1024国产精品| 丁香另类激情小说| 中文字幕一区二区三区在线不卡| 美腿丝袜亚洲三区| 69av一区二区三区| 首页综合国产亚洲丝袜| 欧美一区二区三区不卡| 一区二区免费看| 色香蕉久久蜜桃| 中文字幕免费观看一区| 日本美女一区二区三区视频| 色呦呦网站一区| 亚洲成a人v欧美综合天堂下载| 欧美精品一卡二卡| 国产电影一区在线| 精品福利一二区| www.日韩在线| 香蕉成人啪国产精品视频综合网| 97aⅴ精品视频一二三区| 亚洲福利电影网| 国产欧美日韩另类一区| 色哟哟精品一区| 极品美女销魂一区二区三区免费|