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

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

?? qextdatetimespinbox.cpp

?? Linux/Windows 環境下的跨平臺開發程序
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
#include <qlineedit.h>
#include "qextdatetimespinbox.h"

/*!
\fn QextDateTimeSpinBox::QextDateTimeSpinBox(QWidget* parent=NULL, const char* name=NULL,
    const QString* format=NULL, const QDate* date=NULL, const QTime* time=NULL, 
    const QStringList* days=NULL, const QStringList* months=NULL)
Constructs a QextDateTimeSpinBox with date given by the date argument and time given by the 
time argument.  The control will use the strings provided in the days and months QString arrays. 
The date and time will be formatted as specified in the format argument, using the following 
format specifiers:

\verbatim
%A  uppercase AM/PM indicator ("AM" or "PM")
%a  lowercase AM/PM indicator ("am" or "pm")
%d  Day (1-31, depending on the current month)
%H  Hour, on a 24-hour clock (0-23)
%h  Hour, on a 12-hour clock (1-12)
%M  Month (1-12)
%m  Month String ("January", "February", etc.)
%n  Minute (0-59)
%s  Second (0-59)
%w  Day of the week ("Sunday", "Monday", etc.)
%Y  4-digit year (1752-8000)
%y  2-digit year (0-99)
\endverbatim

The specifiers can also be modified with integers - for example %3w will print the first 3 letters
of the day of the week ("Sun", "Mon", etc.).

A 0 in a specifier indicates that leading zeros will be added where applicable.  For example %0M 
will represent January as "01".  A zero in a non-integer specifier indicates right-alignment.  
For example %0m will represent May as "      May".  Note the leading spaces.  The length of the 
field will be specified by the longest string in the Months member array.

If for example we want the format to be 17:52:07 Tue 27 Feb 2010, the widget would be created
like this:

\code
QString format("%0H:%n:%s %3w %d %3m %Y");
QextDateTimeSpinBox* DateTime=new QextDateTimeSpinBox(&format);
\endcode
  
If the date or time arguments are NULL or unspecified, the widget will use the current date or 
time as returned by QDate::currentDate() or QTime::currentTime().  If the daysor months 
structures are NULL or unspecified, the default day and/or month names will be used.
*/
QextDateTimeSpinBox::QextDateTimeSpinBox(QWidget* parent, const char* name, 
                                         const QString* format, const QDate* date, 
                                         const QTime* time, const QStringList* days,
                                         const QStringList* months):QSpinBox(parent, name) {

    //initialize default names for days and months
    QStringList defDays;
    QStringList defMonths;
    defDays+="Monday";
    defDays+="Tuesday";
    defDays+="Wednesday";
    defDays+="Thursday";
    defDays+="Friday";
    defDays+="Saturday";
    defDays+="Sunday";
    defMonths+="January";
    defMonths+="February";
    defMonths+="March";
    defMonths+="April";
    defMonths+="May";
    defMonths+="June"; 
    defMonths+="July";
    defMonths+="August"; 
    defMonths+="September";
    defMonths+="October";
    defMonths+="November";
    defMonths+="December";

    //set up display strings
    if (days) {
        if (months) {
            setStrings(*days, *months);
        }
        else {
            setStrings(*days, defMonths);
        }
    }
    else {
        if (months) {
            setStrings(defDays, *months);
        }
        else {
            setStrings(defDays, defMonths);
        }
    }

    //set up validator class
    Validator=new QextDateTimeValidator(this, "Date/Time Validator");

    //set up date
    if (date) {
        setDate(*date);
    }
    else {
        setDate(QDate::currentDate());
    }

    //set up time
    if (time) {
        setTime(*time);
    }
    else {
        setTime(QTime::currentTime());
    }

    //enable the down button when the control is first displayed   
    setValue(1);

    //connect to slots
    QObject::connect(editor(), SIGNAL(textChanged(const QString&)), 
            this, SLOT(onEditTextChanged(const QString&)));

    //set up display format
    if (format) {
        setFormat(*format);
    }

    //default format: e.g. "12:00:00 Mon 1 Jan 2001"
    else {
        setFormat(QString("%0H:%n:%s %3w %d %3m %Y"));
    }

    //initialize display
    refresh();
}

/*!
\fn QextDateTimeSpinBox::~QextDateTimeSpinBox()
Standard destructor.
*/
QextDateTimeSpinBox::~QextDateTimeSpinBox() {
    delete Validator;
}

/*!
\fn QDate QextDateTimeSpinBox::date(void) const
Returns the most recent valid date entered into the control.  
*/
QDate QextDateTimeSpinBox::date(void) const {
    return Date;
}

/*!
\fn QextDateTimeValidator::Token const* QextDateTimeSpinBox::fieldFromIndex(int index) const
returns a pointer to a QextDateTimeValidator::Token data structure pertaining to the field in the 
editor in which the cursor lies.  Used internally.  If the value of index goes beyond the length 
of the string contained in the editor, NULL will be returned.
*/
QextDateTimeValidator::Token const* QextDateTimeSpinBox::fieldFromIndex(int index) {
    int CurIndex=0;

    //find which field cursor is in
    QextDateTimeValidator::Token const* curToken=Validator->displayFormat();
    QextDateTimeValidator::Token const* retVal=curToken;
    while (CurIndex<=index && curToken) {
        CurIndex+=fieldSize(curToken);
        retVal=curToken;
        curToken=curToken->Next;
    }

    //return NULL if we've passed the end of the string
    if (CurIndex<=index) {
        return NULL;
    }
    return retVal;
}

/*!
\fn int QextDateTimeSpinBox::fieldSize(QextDateTimeValidator::Token const* Field) const
returns the length of the token represented by Field.  Used internally.
*/
int QextDateTimeSpinBox::fieldSize(QextDateTimeValidator::Token const* Field) const {
    int FieldSize=0;
    int hour, day, month;

    //fixed-size fields
    if (Field->IsFixedSize) {
        FieldSize=Field->MaxSize;
    }

    //variable-sized fields
    else {
        switch (Field->FType) {
            case QextDateTimeValidator::FIELD_DAY:
                day=Date.day();
                if (day<10) {
                    FieldSize=1;
                }
                else {
                    FieldSize=2;
                }
                break;

            case QextDateTimeValidator::FIELD_HOUR_12:
            case QextDateTimeValidator::FIELD_HOUR_24:
                hour=Time.hour();
                if (hour<10) {
                    FieldSize=1;
                }
                else {
                    FieldSize=2;
                }
                break;

            case QextDateTimeValidator::FIELD_MONTH:
                month=Date.month();
                if (month<10) {
                    FieldSize=1;
                }
                else {
                    FieldSize=2;
                }
                break;

            case QextDateTimeValidator::FIELD_DAY_STRING:
                FieldSize=longDayName(Date.dayOfWeek()).length();
                break;

            case QextDateTimeValidator::FIELD_MONTH_STRING:
                FieldSize=longMonthName(Date.month()).length();
                break;
        }
    }
    return FieldSize;
}

/*!
\fn QString QextDateTimeSpinBox::format(void)
Returns the current format string used by the control.  The string returned will use the format 
specifiers described in the documentation for 
QextDateTimeSpinBox::QextDateTimeSpinBox(const QString*, const QDate*, const QTime*,
                                         const QString*, const QString*).
*/
QString QextDateTimeSpinBox::format(void) const {
    return Format;
}

/*!
\fn int QextDateTimeSpinBox::indexFromField(QextDateTimeValidator::Token const* field)
returns the starting offset of the field represented by the QextDateTimeValidator::Token 
pointer in the editor.
*/
int QextDateTimeSpinBox::indexFromField(QextDateTimeValidator::Token const* field) {
    int CurIndex=0;

    //find which field the cursor is in
    QextDateTimeValidator::Token const* curToken=Validator->displayFormat();
    while (curToken!=field) {
        CurIndex+=fieldSize(curToken);
        curToken=curToken->Next;
    }

    //if in a right-justified month string, adjust index for leading spaces
    if (field->FType==QextDateTimeValidator::FIELD_MONTH_STRING && field->IsRightJustified) {
        CurIndex+=Validator->maxMonthStringSize()-longMonthName(Date.month()).length();
    }

    //if in a right-justified day string, adjust index for leading spaces
    if (field->FType==QextDateTimeValidator::FIELD_DAY_STRING && field->IsRightJustified) {
        CurIndex+=Validator->maxDayStringSize()-longDayName(Date.dayOfWeek()).length();
    }
    return CurIndex;
}

/*!
\fn QString QextDateTimeSpinBox::mapValueToText(int)
Trivial override of the default QSpinBox behavior - text does not map directly to a value in this 
case.
*/
int QextDateTimeSpinBox::mapTextToValue(bool* ok) {
    *ok=TRUE;
    return 1;
}

/*!
\fn QString QextDateTimeSpinBox::mapValueToText(int)
overrides default string interpreter - integer values do not map to anything in this case
*/
QString QextDateTimeSpinBox::mapValueToText(int) {
    QString str(tr(""));
    Validator->makeString(str, Date, Time);
    return str;
}

/*!
\fn void QextDateTimeSpinBox::onEditTextChanged(const QString& text)
[public slot]
called when editor text changes
*/
void QextDateTimeSpinBox::onEditTextChanged(const QString& text) {
	QDate date;
    QString string=text;
    int i=0;

    //acceptable string in editor - update internal info, and update display
    if(Validator->validate(string, i) == QValidator::Acceptable) {
        Date.setYMD(Date.year(), Date.month(), Date.day());
        refresh();
    }

    //intermediate string - do nothing
    else if (Validator->validate(string, i) == QValidator::Intermediate) {
    }

    //unacceptable string in editor - update display with last valid date and time
    else {
        refresh();
    }
}

/*!
\fn void QextDateTimeSpinBox::onFormatChanged(const QString& text)
[public slot]
called when format specifier string changes.  
*/
void QextDateTimeSpinBox::onFormatChanged(const QString& text) {
	QDate date;
    QString string=text;
    int i=0;

    //acceptable string in editor - update internal info, and update display
    if (Validator->validate(string, i) == QValidator::Acceptable) {
        Date.setYMD(Date.year(), Date.month(), Date.day());
        setFormat(text);
    }

    //intermediate string - do nothing
    else if (Validator->validate(string, i) == QValidator::Intermediate) {
    }

    //unacceptable string in editor - update display with last valid date and time
    else {
        refresh();
    }
}

/*!
\fn void QextDateTimeSpinBox::refresh()
refreshes the text in the editor
*/
void QextDateTimeSpinBox::refresh() {

    //validator creates the display string
    QString str("");
    Validator->makeString(str, Date, Time);
    
    //display string and place cursor at appropriate location
    editor()->setText(str);
    editor()->setCursorPosition(CursorPos);
}

/*!
\fn void QextDateTimeSpinBox::setDate(const QDate& date)
Sets the date used by the control to the one specified by the date argument.
*/
void QextDateTimeSpinBox::setDate(const QDate& date) {
    Date=date;
}

/*!
\fn void QextDateTimeSpinBox::setDefaultStrings(void)
Sets up default day and month strings.
*/
void QextDateTimeSpinBox::setDefaultStrings(void) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成av人影院| 成人免费看片app下载| 国产剧情一区二区| 欧美亚洲国产bt| 久久久久久久久97黄色工厂| 亚洲免费资源在线播放| 亚洲bdsm女犯bdsm网站| 日韩欧美123| 亚洲精品免费播放| 国产一区二区福利视频| 51精品国自产在线| 亚洲一区二区在线观看视频| 国产激情一区二区三区四区| 3d动漫精品啪啪| 亚洲一卡二卡三卡四卡| 91在线视频在线| 国产精品天干天干在线综合| 精品一区二区三区视频在线观看| 欧美偷拍一区二区| 亚洲女爱视频在线| 99久久99久久精品国产片果冻| 精品国产亚洲在线| 久色婷婷小香蕉久久| 精品1区2区3区| 一区二区三区在线观看国产| a亚洲天堂av| 中文字幕制服丝袜成人av| 国产成人三级在线观看| 精品国内片67194| 国产综合久久久久影院| 欧美大度的电影原声| 蜜桃视频在线观看一区| 日韩午夜中文字幕| 久久黄色级2电影| 精品国产sm最大网站免费看| 久久精品国产亚洲高清剧情介绍| 3d成人动漫网站| 裸体健美xxxx欧美裸体表演| 91精品福利在线一区二区三区 | 一区在线播放视频| 成人教育av在线| 日韩一区欧美小说| av在线不卡观看免费观看| 亚洲视频在线一区观看| 93久久精品日日躁夜夜躁欧美| 亚洲三级久久久| 欧美日韩黄色一区二区| 免费观看在线色综合| 久久夜色精品国产噜噜av| 国产91在线|亚洲| 亚洲男人电影天堂| 欧美日本视频在线| 久久国产精品99久久人人澡| 久久精品欧美日韩| 色婷婷综合久久久中文一区二区| 一个色综合网站| 欧美刺激午夜性久久久久久久| 韩国在线一区二区| 亚洲精品成人在线| 日韩欧美在线123| 99久久精品一区二区| 性做久久久久久免费观看欧美| 日韩午夜激情av| 国产不卡免费视频| 亚洲成人免费看| 久久久综合视频| 在线视频一区二区免费| 久久国产福利国产秒拍| 亚洲欧洲国产专区| 日韩精品一区在线观看| 99久久婷婷国产| 日本vs亚洲vs韩国一区三区 | 轻轻草成人在线| 国产精品亲子伦对白| 欧美日韩免费观看一区二区三区| 久久99精品久久久久久国产越南| 国产精品国产a级| 日韩欧美的一区| 欧美日韩亚洲综合一区二区三区 | 一区二区三区免费看视频| 日韩一区二区在线免费观看| 成人高清在线视频| 青青草伊人久久| 日韩理论电影院| 久久精品在这里| 欧美一区二区三区在| 91欧美一区二区| 国产精品1区二区.| 麻豆精品蜜桃视频网站| 亚洲一区二区欧美| 亚洲少妇30p| 久久久91精品国产一区二区三区| 欧美日韩视频在线第一区 | 国产校园另类小说区| 337p亚洲精品色噜噜噜| 在线亚洲精品福利网址导航| 成人不卡免费av| 国产精品一二三区在线| 激情五月婷婷综合| 青娱乐精品视频在线| 日韩1区2区日韩1区2区| 亚洲国产日韩av| 青青国产91久久久久久| 丝袜诱惑制服诱惑色一区在线观看 | 一区二区国产盗摄色噜噜| 国产精品入口麻豆原神| 国产欧美中文在线| 亚洲精品一线二线三线| 日韩美一区二区三区| 91精品国产综合久久国产大片| 欧美日韩一区视频| 欧美日韩视频一区二区| 欧美精品乱码久久久久久| 在线免费不卡视频| 91精彩视频在线观看| 91美女片黄在线| 欧美视频在线播放| 欧美日韩国产片| 欧美高清性hdvideosex| 91精品久久久久久蜜臀| 日韩一区二区三区四区五区六区 | 欧美精品一区二区三区视频| 日韩一区二区在线看| 日韩欧美一区二区视频| 亚洲精品一区二区三区香蕉| 久久久另类综合| 国产精品狼人久久影院观看方式| 国产精品毛片久久久久久| 中文字幕一区二区三区在线播放| 亚洲欧洲av另类| 亚洲一级二级三级在线免费观看| 亚洲一区二区av在线| 美女视频黄 久久| 国产麻豆精品视频| 91在线视频网址| 欧美欧美欧美欧美首页| 精品国产第一区二区三区观看体验| 久久一区二区三区四区| 成人免费小视频| 日精品一区二区三区| 狠狠久久亚洲欧美| 91农村精品一区二区在线| 精品污污网站免费看| xfplay精品久久| 亚洲免费毛片网站| 毛片av一区二区| 福利一区二区在线| 欧美性视频一区二区三区| 日韩欧美中文一区二区| 国产精品嫩草99a| 日韩专区欧美专区| 丁香桃色午夜亚洲一区二区三区 | 国产精品影视网| 欧美午夜一区二区三区免费大片| 欧美一三区三区四区免费在线看| 国产亚洲综合在线| 亚洲国产中文字幕| 国产1区2区3区精品美女| 欧美丝袜丝交足nylons图片| 久久久av毛片精品| 亚洲五月六月丁香激情| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 亚洲女同一区二区| 精品在线观看视频| 欧美日韩一级片在线观看| 国产精品色噜噜| 久久草av在线| 欧美日韩在线观看一区二区| 久久精品水蜜桃av综合天堂| 五月激情综合色| 色综合久久久网| 国产欧美日韩三区| 久草精品在线观看| 欧美日韩一区中文字幕| 中文字幕欧美一| 国产电影一区二区三区| 日韩美女视频在线| 午夜精品久久久久久久| 97精品久久久午夜一区二区三区 | 久久久噜噜噜久久中文字幕色伊伊| 亚洲精品成人精品456| 国产91精品在线观看| 精品三级av在线| 蜜桃久久久久久| 日韩一级免费观看| 午夜天堂影视香蕉久久| 91麻豆swag| 亚洲免费电影在线| 91亚洲男人天堂| 国产精品国产三级国产普通话99| 精品一区在线看| 精品国产乱码久久久久久久| 日本成人在线电影网| 777xxx欧美| 日韩高清不卡一区二区三区| 欧美日韩另类一区| 亚洲超碰97人人做人人爱| 色噜噜狠狠成人网p站| 亚洲柠檬福利资源导航| 日本久久电影网|