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

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

?? qspinbox.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************** $Id: qt/src/widgets/qspinbox.cpp   2.3.12   edited 2005-10-27 $**** Implementation of QSpinBox widget class**** Created : 1997**** 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 "qspinbox.h"#ifndef QT_NO_SPINBOX#include "qspinbox.h"#include "qpushbutton.h"#include "qpainter.h"#include "qbitmap.h"#include "qlineedit.h"#include "qvalidator.h"#include "qpixmapcache.h"#include "qapplication.h"#ifdef QT_KEYPAD_MODEextern bool qt_modalEditingEnabled;#endifstruct QSpinBoxPrivate{    QSpinBoxPrivate(): buttonSymbols( QSpinBox::UpDownArrows ) {}    QSpinBox::ButtonSymbols buttonSymbols;};// REVISED: warwick/*!  \class QSpinBox qspinbox.h  \brief The QSpinBox class provides a spin box widget, sometimes called	  up-down widget, little arrows widget or spin button.  \ingroup basic  QSpinBox allows the user to choose a value, either by  clicking the up/down buttons to increase/decrease the value  currently displayed, or by typing the value directly into the spin  box. Usually the value is an integer.  Every time the value changes, QSpinBox emits the valueChanged()  signal.  The current value can be fetched with value() and set with  setValue().  The spin box clamps the value within a numeric range, see  QRangeControl for details.  Clicking the up/down down buttons (or  using the keyboard accelerators: Up-arrow and Down-arrow) will  increase or decrease the current value in steps of size lineStep().  Most spin boxes are directional, but QSpinBox can also operate as a  circular spin box, i.e. if the range is 0-99 and the current value  is 99, clicking Up will give 0.  Use setWrapping() if you want  circular behavior.  The displayed value can be prepended and/or appended with an  arbitrary string indicating for example the unit of measurement.  See setPrefix() and setSuffix().  Normally, the spin box displays up and down arrows in the buttons.  You can use setButtonSymbols() to change the display to  show + and - symbols, if this is clearer for your intended purpose.  In either case, the up and down arrow keys always work.  It is often desirable to give the user a special, often default,  choice in addition to the range of numeric values.  See  setSpecialValueText() for how to do this with QSpinBox.  The default \l QWidget::focusPolicy() is StrongFocus.  QSpinBox can easily be subclassed to allow the user to input other  things than an integer value, as long as the allowed input can be  mapped down to a range of integers.  This can be done by overriding  the virtual functions mapValueToText() and mapTextToValue() and  setting another, suitable validator using setValidator(). For example,  these function could be changed so that the user provided values  from 0.0 to 10.0 while the range of integers used inside the program  would be 0 to 100:  \code  class MySpinBox : public QSpinBox {  public:    ...    QString	mapValueToText( int value )    {      return QString("%1.%2").arg(value/10).arg(value%10);    }    int		mapTextToValue( bool* ok )    {      return int(text().toFloat()*10);    }  };  \endcode  <img src=qspinbox-m.png> <img src=qspinbox-w.png>  \sa QScrollBar QSlider  <a href="guibooks.html#fowler">GUI Design Handbook: Spin Box</a>*//*!  Constructs a spin box with the default QRangeControl range and step  values.  \sa minValue(), maxValue(), setRange(), lineStep(), setSteps()*/QSpinBox::QSpinBox( QWidget * parent , const char *name )    : QFrame( parent, name ),      QRangeControl(){    initSpinBox();}/*!  Constructs a spin box with range from \a minValue to \a maxValue  inclusive, with step amount \a step.  The value is initially  set to \a minValue.  \sa minValue(), maxValue(), setRange(), lineStep(), setSteps()*/QSpinBox::QSpinBox( int minValue, int maxValue, int step, QWidget* parent,		    const char* name )    : QFrame( parent, name ),      QRangeControl( minValue, maxValue, step, step, minValue ){    initSpinBox();}/*!  \internal Initialization.*/void QSpinBox::initSpinBox(){    d = 0;    wrap = FALSE;    edited = FALSE;    up = new QPushButton( this, "up" );    up->setFocusPolicy( QWidget::NoFocus );    up->setAutoDefault( FALSE );    up->setAutoRepeat( TRUE );    down = new QPushButton( this, "down" );    down->setFocusPolicy( QWidget::NoFocus );    down->setAutoDefault( FALSE );    down->setAutoRepeat( TRUE );    validate = new QIntValidator( minValue(), maxValue(), this, "validator" );    vi = new QLineEdit( this, "line editor" );    vi->setFrame( FALSE );    setFocusProxy( vi );    setFocusPolicy( StrongFocus );    vi->setValidator( validate );    vi->installEventFilter( this );    if ( style() == WindowsStyle )	setFrameStyle( WinPanel | Sunken );    else	setFrameStyle( Panel | Sunken );    setLineWidth( 2 );    setPalettePropagation( AllChildren );    setFontPropagation( AllChildren );    setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) );    updateDisplay();    connect( up, SIGNAL(pressed()), SLOT(stepUp()) );    connect( down, SIGNAL(pressed()), SLOT(stepDown()) );    connect( vi, SIGNAL(textChanged(const QString&)), SLOT(textChanged()) );}/*!  Destroys the spin box, freeing all memory and other resources.*/QSpinBox::~QSpinBox(){    delete d;}/*!  Returns the current text of the spin box, including any prefix() and suffix().  \sa value()*/QString QSpinBox::text() const{    return vi->text();}/*!  Returns a copy of the current text of the spin box with any prefix  and/or suffix and white space at the start and end removed.  \sa text(), setPrefix(), setSuffix()*/QString QSpinBox::cleanText() const{    QString s = QString(text()).stripWhiteSpace();    if ( !prefix().isEmpty() ) {	QString px = QString(prefix()).stripWhiteSpace();	int len = px.length();	if ( len && s.left(len) == px )  // Remove _only_ if it is the prefix	    s.remove( 0, len );    }    if ( !suffix().isEmpty() ) {	QString sx = QString(suffix()).stripWhiteSpace();	int len = sx.length();	if ( len && s.right(len) == sx )  // Remove _only_ if it is the suffix	    s.truncate( s.length() - len );    }    return s.stripWhiteSpace();}/*!  Sets the special-value text to \a text.  If set, the spin box will  display this text instead of a numeric value whenever the current  value is equal to minVal().  Typically used for indicating that this  choice has a special (default) meaning.  For example, if your spin box allows the user to choose the  margin width in a print dialog, and your application is able to  automatically choose a good margin width, you can set up the spin  box like this:  \code    QSpinBox marginBox( -1, 20, 1, parent, "marginBox" );    marginBox->setSuffix( " mm" );    marginBox->setSpecialValueText( "Auto" );  \endcode  The user will then be able to choose a margin width from 0-20  millimeters, or select "Auto" to leave it to the application to  choose.  Your code must then interpret the spin box value of -1 as  the user requesting automatic margin width.  Neither \link setPrefix prefix\endlink nor \link setSuffix  suffix,\endlink if set, are added to the special-value text when  displayed.  To turn off the special-value text display, call this function with  an empty string as parameter. The default is no special-value text,  i.e. the numeric value is shown as usual.  \sa specialValueText()*/void QSpinBox::setSpecialValueText( const QString &text ){    specText = text;    updateDisplay();}/*!  Returns the currently special-value text, or a null string if no  special-value text is currently set.  \sa setSpecialValueText()*/QString QSpinBox::specialValueText() const{    if ( specText.isEmpty() )	return QString::null;    else	return specText;}/*!  Sets the prefix to \a text.  The prefix is prepended to the start of  the displayed value.  Typical use is to indicate the unit of  measurement to the user. eg.  \code    sb->setPrefix("$");  \endcode  To turn off the prefix display, call this function with an empty  string as parameter.  The default is no prefix.  \sa prefix(), setSuffix(), suffix()*/void QSpinBox::setPrefix( const QString &text ){    pfix = text;    updateDisplay();}/*!  Sets the suffix to \a text.  The suffix is appended to the end of the  displayed value.  Typical use is to indicate the unit of measurement  to the user. eg.  \code    sb->setSuffix("cm");  \endcode  To turn off the suffix display, call this function with an empty  string as parameter.  The default is no suffix.  \sa suffix(), setPrefix(), prefix()*/void QSpinBox::setSuffix( const QString &text ){    sfix = text;    updateDisplay();}/*!  Returns the currently set prefix, or a null string if no prefix is  set.  \sa setPrefix(), setSuffix(), suffix()*/QString QSpinBox::prefix() const{    if ( pfix.isEmpty() )	return QString::null;    else	return pfix;}/*!  Returns the currently set suffix, or a null string if no suffix is  set.  \sa setSuffix(), setPrefix(), suffix()*/QString QSpinBox::suffix() const{    if ( sfix.isEmpty() )	return QString::null;    else	return sfix;}/*!  Setting wrapping to TRUE will allow the value to be stepped from the  highest value to the lowest, and vice versa.  By default, wrapping is  turned off.  \sa wrapping(), minValue(), maxValue(), setRange()*/void QSpinBox::setWrapping( bool on ){    wrap = on;    updateDisplay();}/*!  Returns the current setWrapping() value.*/bool QSpinBox::wrapping() const{    return wrap;}/*!\reimp*/QSize QSpinBox::sizeHint() const{    constPolish();    QFontMetrics fm = fontMetrics();    int h = fm.height();    if ( h < 12 ) 	// ensure enough space for the button pixmaps	h = 12;    int w = 35; 	// minimum width for the value    int wx = fm.width( ' ' )*2 * style().pixelMetric(QStyle::SpinBoxHExtraScale);    QString s;    s = prefix() + ( (QSpinBox*)this )->mapValueToText( minValue() ) + suffix();    w = QMAX( w, fm.width( s ) + wx);    s = prefix() + ( (QSpinBox*)this )->mapValueToText( maxValue() ) + suffix();    w = QMAX(w, fm.width( s ) + wx );    if ( !specialValueText().isEmpty() ) {	s = specialValueText();	w = QMAX( w, fm.width( s ) + wx );    }    QSize r( (h*style().pixelMetric(QStyle::SpinBoxButtonScale)) // buttons AND frame both sides - see resizeevent()	     + style().pixelMetric(QStyle::SpinBoxHMargin) // right/left margins	     + w, // widest value	     frameWidth() * 2 // top/bottom frame	     + style().pixelMetric(QStyle::SpinBoxVMargin) // top/bottom margins	     + h // font height	     );    return r.expandedTo( QApplication::globalStrut() );}// Does the layout of the lineedit and the buttonsvoid QSpinBox::arrangeWidgets(){    if ( !up || !down ) // may happen if the application has a pointer error	return;    QSize bs; // no, it's short for 'button size'    if ( style() == WindowsStyle )	bs.setHeight( height()/2 - frameWidth() );    else	bs.setHeight( height()/2 );    if ( bs.height() < 8 )	bs.setHeight( 8 );    bs.setWidth( bs.height() * 8 / 5 ); // 1.6 - approximate golden mean    if ( style() == WindowsStyle )	setFrameRect( QRect( 0, 0, 0, 0 ) );    else	setFrameRect( QRect( 0, 0, width() - bs.width(), height() ) );    if ( up->size() != bs || down->size() != bs ) {	up->resize( bs );	down->resize( bs );	updateButtonSymbols();    }    int y = style() == WindowsStyle ? frameWidth() : 0;    int x = width() - y - bs.width();    up->move( x, y );    down->move( x, height() - y - up->height() );    if ( style() == WindowsStyle )	vi->setGeometry( frameWidth(), frameWidth(),			 x - frameWidth(), height() - 2*frameWidth() );    else	vi->setGeometry( contentsRect() );}/*!\reimp*/QSizePolicy QSpinBox::sizePolicy() const{    //### removeme 3.0    return QWidget::sizePolicy();}/*!  Sets the current value of the spin box to \a value.  This is  QRangeControl::setValue() made available as a slot.*/void QSpinBox::setValue( int value ){    QRangeControl::setValue( value );}/*!  Increases the current value one step, wrapping as necessary.  This is  the same as clicking on the pointing-up button, and can be used for  e.g.  keyboard accelerators.  \sa stepDown(), addLine(), lineStep(), setSteps(), setValue(), value()*/void QSpinBox::stepUp(){    if ( edited )	interpretText();    if ( wrapping() && ( value()+lineStep() > maxValue() ) )	setValue( minValue() );    else	addLine();}/*!  Decreases the current value one step, wrapping as necessary.  This is  the same as clicking on the pointing-down button, and can be used  for e.g.  keyboard accelerators.  \sa stepUp(), subtractLine(), lineStep(), setSteps(), setValue(), value()*/void QSpinBox::stepDown(){    if ( edited )	interpretText();    if ( wrapping() && ( value()-lineStep() < minValue() ) )	setValue( maxValue() );    else	subtractLine();}/*!  \fn void QSpinBox::valueChanged( int value )  This signal is emitted every time the value of the spin box changes  (whatever the cause - by setValue(), by a keyboard accelerator, by  mouse clicks etc.).  Note that it is emitted \e every time, not just for the "final" step  - if the user clicks 'up' three times, this signal is emitted three  times.  \sa value()*//*!  \fn void QSpinBox::valueChanged( const QString& valueText )  This signal is emitted whenever the valueChanged( int ) signal is  emitted, i.e.  every time the value of the spin box changes (whatever  the cause - by setValue(), by a keyboard accelerator, by mouse  clicks etc.).

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲另类春色国产| 91一区二区在线| 国产成人午夜精品影院观看视频| 日韩精品在线看片z| 久久这里只有精品6| 国产精品久久久久久福利一牛影视 | 欧美精品丝袜中出| 精品福利一区二区三区免费视频| 欧美韩日一区二区三区| 亚洲自拍偷拍图区| 国产麻豆一精品一av一免费| 91网站最新地址| 日韩免费一区二区三区在线播放| 国产喷白浆一区二区三区| 亚洲亚洲精品在线观看| 国产美女精品人人做人人爽| 91在线云播放| 精品久久一二三区| 亚洲永久精品大片| 国内精品写真在线观看| 日本大香伊一区二区三区| 精品国产一区二区精华| 亚洲男人的天堂在线观看| 麻豆国产精品视频| 一本一道综合狠狠老| 亚洲精品一区二区三区福利| 亚洲精选免费视频| 国产资源在线一区| 欧美喷水一区二区| 国产精品传媒视频| 国内精品国产成人国产三级粉色| 99国产欧美久久久精品| 精品国产免费人成电影在线观看四季 | 精品国内二区三区| 亚洲综合男人的天堂| 激情综合网av| 精品视频1区2区3区| 国产精品久久久久国产精品日日| 日韩av电影免费观看高清完整版| 99久久精品情趣| 久久无码av三级| 香蕉影视欧美成人| 97se亚洲国产综合自在线| 久久婷婷国产综合国色天香| 五月开心婷婷久久| 日本韩国欧美在线| 中文一区二区在线观看| 精品亚洲免费视频| 91精品在线免费观看| 亚洲影院免费观看| 色哟哟日韩精品| 中文字幕亚洲一区二区va在线| 国内久久精品视频| 精品免费国产一区二区三区四区| 亚洲国产乱码最新视频 | 亚洲免费观看在线观看| 国产激情视频一区二区在线观看 | 三级成人在线视频| 91久久精品一区二区三| 中文字幕一区三区| 成人h动漫精品一区二区| 国产午夜久久久久| 黄色成人免费在线| 日韩精品中文字幕一区| 麻豆精品视频在线观看| 欧美一区二区三区公司| 日韩激情一二三区| 欧美一区二区三区四区视频| 无码av免费一区二区三区试看| 欧美主播一区二区三区美女| 亚洲免费观看高清在线观看| 91蜜桃网址入口| 亚洲女同女同女同女同女同69| av电影天堂一区二区在线观看| 国产精品三级视频| aaa欧美日韩| 又紧又大又爽精品一区二区| 一本一道久久a久久精品综合蜜臀| 亚洲色图都市小说| 色呦呦国产精品| 亚洲chinese男男1069| 欧美日韩国产123区| 日韩黄色免费网站| 91精品国产综合久久精品性色 | 在线不卡一区二区| 日本强好片久久久久久aaa| 日韩一区二区在线观看视频| 麻豆精品一二三| 国产欧美日韩精品一区| 99国产欧美久久久精品| 亚洲午夜在线观看视频在线| 91麻豆精品国产自产在线| 久久99精品视频| 国产亚洲成aⅴ人片在线观看 | 亚洲图片激情小说| 在线日韩一区二区| 琪琪久久久久日韩精品| 精品国产伦一区二区三区观看体验 | 欧美影视一区在线| 石原莉奈在线亚洲三区| 精品国产亚洲在线| 成人午夜激情影院| 亚洲一区二区三区影院| 欧美一级午夜免费电影| 国产精品一区二区三区乱码| 国产精品不卡在线| 欧美日韩免费观看一区三区| 精品一区二区三区免费观看| 国产精品免费免费| 欧美日韩在线播放三区四区| 蜜桃视频一区二区| 成人免费在线视频| 欧美日韩国产另类不卡| 国产剧情一区二区| 亚洲欧美另类图片小说| 欧美一区二区美女| 不卡一区二区在线| 美腿丝袜亚洲三区| 中文字幕在线不卡一区二区三区| 欧美日韩精品一区二区天天拍小说 | 91视频www| 蜜桃免费网站一区二区三区| 国产精品免费视频网站| 91精品国产综合久久久蜜臀粉嫩 | 亚洲婷婷综合色高清在线| 欧美日韩国产成人在线91| 国产+成+人+亚洲欧洲自线| 亚洲国产aⅴ天堂久久| 精品久久一区二区| 欧美在线不卡一区| 国产精品主播直播| 午夜欧美视频在线观看 | 99久久精品免费观看| 日本免费新一区视频| 中文字幕在线观看一区| 欧美成va人片在线观看| 日本韩国一区二区| 国产精品99久久久久久久女警| 亚洲福利视频一区二区| 中文字幕av一区 二区| 欧美一级片免费看| 一本到不卡精品视频在线观看| 精品一区二区免费| 天天操天天色综合| 亚洲日本免费电影| 国产午夜亚洲精品理论片色戒| 欧美日韩一卡二卡三卡| 成人精品免费网站| 国产在线精品一区二区夜色 | 91麻豆精品91久久久久同性| 99精品在线免费| 国产精品主播直播| 久久99久久精品| 亚洲成人高清在线| 亚洲美女区一区| 欧美激情一区三区| 精品日韩在线观看| 555www色欧美视频| 91行情网站电视在线观看高清版| 国产成人精品免费在线| 蜜臀av国产精品久久久久| 亚洲v中文字幕| 一区二区三区四区不卡视频| 欧美国产精品一区二区三区| 精品国产成人系列| 日韩手机在线导航| 欧美日韩二区三区| 欧美性色黄大片| 欧美午夜宅男影院| 91蝌蚪porny九色| 99re这里只有精品首页| 成人美女视频在线观看18| 国产美女在线观看一区| 久久99久久精品| 日本aⅴ亚洲精品中文乱码| 亚洲午夜成aⅴ人片| 亚洲精品乱码久久久久| 一区二区三区四区国产精品| 亚洲视频在线一区观看| 亚洲视频一区二区在线| 中文字幕一区三区| 亚洲精品五月天| 一区二区三区四区国产精品| 亚洲一区二区三区四区中文字幕| 一区二区久久久久| 亚洲国产另类av| 五月天国产精品| 美国毛片一区二区| 美国十次综合导航| 国产伦精品一区二区三区免费| 国产美女娇喘av呻吟久久| 欧美三区在线观看| 欧美日韩情趣电影| 欧美一区二区精品在线| 亚洲精品一区在线观看| 久久久久久久国产精品影院| 中文字幕欧美三区| 亚洲日本在线视频观看| 亚洲福利视频一区二区| 日本欧美大码aⅴ在线播放|