亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
精品国产一区二区三区久久久蜜月| 91在线国产观看| 亚洲综合免费观看高清完整版| 国产精品成人免费 | 亚洲欧洲日韩女同| 国产欧美精品一区二区三区四区 | 免费不卡在线视频| 国产高清久久久| 精品综合免费视频观看| 另类调教123区 | 国产999精品久久| 东方aⅴ免费观看久久av| 成人app软件下载大全免费| 国产69精品久久99不卡| 成人毛片在线观看| 色婷婷狠狠综合| 欧美日韩国产影片| 精品久久五月天| 国产女人aaa级久久久级| 综合电影一区二区三区| 亚洲国产精品久久人人爱| 亚洲国产精品综合小说图片区| 日韩激情在线观看| 国产精品亚洲专一区二区三区 | 日韩一级片在线播放| 精品成人在线观看| 国产精品欧美精品| 婷婷久久综合九色国产成人 | 中文字幕在线观看一区| 亚洲制服丝袜av| 老司机午夜精品| 99精品黄色片免费大全| 欧美精品在线视频| 亚洲国产精品高清| 日本欧美肥老太交大片| 国产91综合一区在线观看| 色婷婷综合久久久久中文 | 懂色av中文字幕一区二区三区| 色综合视频在线观看| 日韩一区二区在线看| 一区二区中文字幕在线| 麻豆精品新av中文字幕| 日本高清免费不卡视频| 久久网这里都是精品| 亚洲一区二区在线观看视频| 国产一区二区精品在线观看| 欧美午夜视频网站| 国产精品毛片a∨一区二区三区| 婷婷综合久久一区二区三区| 成人av在线影院| 欧美电视剧免费观看| 亚洲综合图片区| 99精品视频在线观看| 精品国产乱码久久久久久闺蜜 | 欧美大白屁股肥臀xxxxxx| 欧美高清在线一区| 经典一区二区三区| 欧美日韩免费视频| 亚洲天堂精品在线观看| 丰满岳乱妇一区二区三区| 日韩三级视频在线看| 五月婷婷久久综合| 日本国产一区二区| 亚洲黄色在线视频| 91美女在线看| 亚洲视频香蕉人妖| 成人爱爱电影网址| 中文乱码免费一区二区| 国产九色sp调教91| 精品久久人人做人人爰| 麻豆精品在线观看| 日韩视频一区在线观看| 日韩电影免费一区| 国产欧美精品一区二区色综合朱莉 | 日韩亚洲欧美在线| 亚洲一区欧美一区| 国产99精品在线观看| 久久久国产精品麻豆| 久久91精品国产91久久小草 | 欧美不卡一二三| 视频一区在线播放| 日韩一区二区三区免费观看| 日韩高清国产一区在线| 欧美一个色资源| 精品一区二区三区欧美| 久久久久久久综合| 成人免费福利片| 中文字幕中文字幕在线一区 | av一区二区三区在线| 国产精品污网站| 99久久久国产精品免费蜜臀| 亚洲另类春色国产| 91.xcao| 狠狠色丁香久久婷婷综合丁香| 久久这里只有精品首页| 成人白浆超碰人人人人| 一区二区不卡在线视频 午夜欧美不卡在| 91视频.com| 日韩激情一区二区| 亚洲欧美综合另类在线卡通| 在线观看日韩国产| 日产国产高清一区二区三区| 国产日韩高清在线| 色婷婷精品大视频在线蜜桃视频| 日韩国产欧美在线观看| 久久久九九九九| 在线观看日韩一区| 精品在线视频一区| 亚洲精品福利视频网站| 精品三级av在线| 一本色道久久综合狠狠躁的推荐 | 精品国产一区二区三区不卡| 不卡一区在线观看| 日本中文字幕一区| 国产精品看片你懂得| 欧美精品乱码久久久久久按摩| 国产在线不卡一区| 亚洲影视在线播放| 国产午夜精品一区二区三区嫩草| 91久久线看在观草草青青| 另类中文字幕网| 亚洲欧洲综合另类| 国产欧美一区二区三区在线看蜜臀 | 免费成人av资源网| 中文字幕av免费专区久久| 精品视频1区2区3区| 国产69精品久久久久毛片| 日韩高清在线不卡| 一区二区三区视频在线观看| 国产日产欧美精品一区二区三区| 在线看国产一区| 国产91丝袜在线观看| 日韩国产一区二| 亚洲图片欧美色图| 亚洲乱码国产乱码精品精可以看| 精品99一区二区三区| 91精品国产色综合久久ai换脸| 色综合婷婷久久| 不卡的av电影在线观看| 国产九色精品成人porny| 美腿丝袜在线亚洲一区| 亚洲午夜精品在线| 亚洲激情图片一区| 一个色在线综合| 亚洲乱码中文字幕| 中文字幕一区二区三区视频| 日本一区二区视频在线观看| 久久蜜桃一区二区| 2014亚洲片线观看视频免费| 欧美一区二区三区成人| 91精品国产入口| 欧美一区二区三区四区视频| 欧美精品精品一区| 欧美日韩高清一区二区| 欧美日韩一区高清| 欧美日韩激情在线| 欧美电影一区二区三区| 中文字幕一区在线观看视频| 久久久久久久网| 国产欧美日本一区视频| 国产精品丝袜91| 亚洲欧美自拍偷拍| 亚洲综合一二区| 午夜精品久久久久久久久久| 亚洲成人免费观看| 日韩在线一区二区| 久久精品国产99国产精品| 国产曰批免费观看久久久| 国产91对白在线观看九色| jlzzjlzz亚洲日本少妇| 91看片淫黄大片一级| 欧美日本视频在线| 精品久久久久久最新网址| 国产午夜亚洲精品不卡| 亚洲精品视频在线观看网站| 日日夜夜一区二区| 韩国中文字幕2020精品| 99re视频精品| 欧美三级日韩三级| wwwwxxxxx欧美| 亚洲精品中文字幕乱码三区| 日本午夜一本久久久综合| 国产一二精品视频| 色丁香久综合在线久综合在线观看| 欧美疯狂做受xxxx富婆| 久久美女艺术照精彩视频福利播放| 亚洲三级在线观看| 日本不卡视频在线观看| 成人91在线观看| 日韩欧美国产一区二区在线播放| 欧美激情在线一区二区| 亚洲成a人v欧美综合天堂下载| 久久成人免费日本黄色| 99视频在线精品| 欧美成人bangbros| 一区二区三区在线视频免费| 久草热8精品视频在线观看| 91黄色激情网站| 国产亚洲精品福利| 日韩精品91亚洲二区在线观看 |