• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ showTime函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中showTime函数的典型用法代码示例。如果您正苦于以下问题:C++ showTime函数的具体用法?C++ showTime怎么用?C++ showTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了showTime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: tr

void MainWindow::sendfun()
{
    if (tein->toPlainText() == "") {
        QMessageBox::information(this, tr("..."), tr("消息为空"));
        return;
    }

    l = new QLabel(teout);
    if (str1 != showTime()) {
        l->setText(showTime());
    }

    str1 = showTime();
    l->setGeometry((this->size().width()) / 2 - 80, a - 10 , 100, 66);
    l->setWordWrap(true);
    l->setAlignment(Qt::AlignHCenter);
    l->show();

    QString str = tein->toHtml();
    str.replace("%3A", ":");
    qDebug() << str;

    TextEdit *t = new TextEdit(teout);

    readxml(str, t);

    pArea->ensureVisible(5, a + 20);
    tein->clear();
}
开发者ID:liuyanfeier,项目名称:Qt-Interface-Of-WeChat,代码行数:29,代码来源:mainwindow.cpp


示例2: QLCDNumber

DigitalClock::DigitalClock(QWidget *parent)
: QLCDNumber(parent)
{
	setSegmentStyle(Filled);
//	setSegmentStyle(Outline);
//	setSegmentStyle(Flat);
	

	setAutoFillBackground(true);
	setStyle(QStyleFactory::create(tr("Windows")) );

	QPalette palette;
	QBrush brush(QColor(255, 0, 0, 255));
	brush.setStyle(Qt::SolidPattern);
	palette.setBrush(QPalette::Active, QPalette::WindowText, brush);
	palette.setBrush(QPalette::Inactive, QPalette::WindowText, brush);
	setPalette(palette);

	setFrameShape(QFrame::NoFrame);
	setFrameShadow(QFrame::Plain);


	QTimer *timer = new QTimer(this);
	connect(timer, SIGNAL(timeout()), this, SLOT(showTime()));
	timer->start(1000);

	showTime();
	
	

//	setWindowTitle(tr("Digital Clock"));
//	resize(150, 60);
}
开发者ID:Sangil-Lee,项目名称:RefCode,代码行数:33,代码来源:digitalclock.cpp


示例3: main

int main()
{   
    /* Enable the global interrupt */
    CyGlobalIntEnable;
    
    /* Enable the Interrupt component connected to interrupt */
    isr_keypress_StartEx(KeyHandler);
    isr_lights_StartEx(InterruptHandler);

	/* Start the components */
    Timer_1_Start();
    debounce_clock_Start();
    
    showTime();
    while (1) {
        if (halfSecond == 0) {
            if (millis > 500) {
                halfSecond = 1;
                showTime();
            }
        } else {
            if (millis <= 500) {
                halfSecond = 0;
                showTime();
            }
        }
    }
    
    return 0;
}
开发者ID:peter-gregory,项目名称:WordClock,代码行数:30,代码来源:main.c


示例4: QTimer

void Timer::startTime()
{


    //  timeValue = hourEdit->value() * 3600 + minEdit->value() * 60 + secEdit->value();
    h = hourEdit->value();
    m =  minEdit->value();
    s = secEdit->value();

    //    if(timeValue == 0)
    if(h == 0 && m == 0 && s == 0)
        return;

    //    QString debug;
    //    qDebug() << "timeValue :" << debug.setNum(timeValue);


    timerSettingFrame->hide();
    timerRunningFrame->show();

    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(showTime()));
    timer->start(1000);

    showTime();




}
开发者ID:jwvdveen,项目名称:plume-creator-legacy,代码行数:30,代码来源:timer.cpp


示例5: QLCDNumber

Clock::Clock(QWidget *parent){
    this->setParent(parent);
    ui.setupUi(this);
    this->move(50,50);

    lcd = new QLCDNumber(this);
    ui.gridLayout->addWidget(lcd, 0, 0);

    clockScene = new QGraphicsScene();
    this->instrumentView = new InstrumentView(this);
    this->instrumentView->setScene(clockScene);
    ui.gridLayout->addWidget(this->instrumentView, 0, 0, 1, 1);

    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(showTime()));
    timer->start(1000);

    showTime();

    sizes << 0.0;
    sizes << 0.30;
    sizes << 0.60;
    index = 0;

    originalSize = new QSize(130, 70);

    setDefaultStyleSheet();
    changeWidgetSize();

    connect(this->instrumentView, SIGNAL(mouseMoved(QMouseEvent*)), this, SLOT(mouseMoveEvent(QMouseEvent*)));
    connect(this->instrumentView, SIGNAL(mousePressed(QMouseEvent*)), this, SLOT(mousePressEvent(QMouseEvent*)));
    connect(this->instrumentView, SIGNAL(mouseDoubleClicked(QMouseEvent*)), this, SLOT(changeSize()));
    this->initializeSettings();
}
开发者ID:pcannon67,项目名称:devel,代码行数:34,代码来源:clock.cpp


示例6: showTime

/**
 * @brief TimerWindow::slotAddTime 增加时间并显示槽
 */
void TimerWindow::slotAddTime()
{
//    qDebug()<<"slotAddTime()";
    ++todayTime;
    ++weekTime;
    showTime(todayTime, labelTodayTime, headToday);
    showTime(weekTime, labelWeekTime, headWeek);
    showTime(weekTime / 7, labelAverageTime, headAverage);
}
开发者ID:mnikn,项目名称:ManageSystem,代码行数:12,代码来源:TimerWindow.cpp


示例7: QMainWindow

eduMAppMenu::eduMAppMenu(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::eduMAppMenu)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::FramelessWindowHint);

    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(showTime()));
    timer->start(1000);

    showTime();

    //currentDirectory = QDir::current();
    currentDirectory = QDir(qApp->applicationDirPath());
    categoriesNames = currentDirectory.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
    categories_layout = new QHBoxLayout;
    apps_layout= new QGridLayout;
    categoryButtonToButtonName_signalMapper = new QSignalMapper(this);
    appsButtonToButtonName_signalMapper = new QSignalMapper(this);
    categoriesWidget = new QWidget;
    appsWidget = new QWidget;
    appProcess = new QProcess(this);

    QString categoryName;
    QPushButton* button;
    if(!categoriesNames.isEmpty())
        for(int i=0; i<categoriesNames.size(); i++)
        {
            categoryName = categoriesNames.value(i);

            if(categoryName.startsWith("."))
                continue;

            categoriesButtons[categoryName]= new QPushButton(categoryName);

            button = categoriesButtons.value(categoriesNames.value(i));
            button->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
            categories_layout->addWidget(button);

            categoryButtonToButtonName_signalMapper->setMapping(button, QString(categoryName));
            QObject::connect(button, SIGNAL(clicked()), categoryButtonToButtonName_signalMapper, SLOT(map()));
        }

    //options_pushButton = new QPushButton("Options");
    //options_pushButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    //categories_layout->addWidget(options_pushButton);

    //QObject::connect(options_pushButton, SIGNAL(clicked()), this, SLOT(showOptions()));

    QObject::connect(categoryButtonToButtonName_signalMapper, SIGNAL(mapped(QString)), this, SLOT(categorySelected(QString)));
    QObject::connect(appsButtonToButtonName_signalMapper, SIGNAL(mapped(QString)), this, SLOT(appSelected(QString)));

    categoriesWidget->setLayout(categories_layout);
    ui->categories_scrollArea->setWidget(categoriesWidget);

}
开发者ID:iahvector,项目名称:edumate-desktop,代码行数:57,代码来源:eduMAppMenu.cpp


示例8: main

int main(void)
{   Time youTime,tempTime;
    int choi;
    printf("Hello....\npress enter");
    getchar();
    printf("ustanovit vremia ili obnulit'>?(1/2)\n");
    scanf("%d",&choi);
    if(choi==1)
        enterTime(&youTime);
    if(choi==2){
        youTime.hour=0;
        youTime.minut=0;
        youTime.sec=0;
    }
    if(choi!=1&&choi!=2){
        fprintf(stderr,"invalid value");
    exit(1);
    }
    tempTime=youTime;
    while(choi!=4){

        printf("1.adding time\n2.show time \n3.diff time\n4.exit\n");
        scanf("%d",&choi);
        system("clear");
        switch (choi) {
        case 1:
           addTime(&tempTime);
           showTime(tempTime);
            break;
        case 2:
            printf("first time\n");
            showTime(youTime);
            printf("real time\n");
            showTime(tempTime);
            break;
        case 3:
            printf(" diff time %d sec\n",chekTime(youTime,tempTime));

            break;
        case 4:
            printf("end.\n");
            break;

        default:
            fprintf(stderr,"inalid value\n");
            exit(1);
            break;
        }


    }



    return 0;
}
开发者ID:aniknaemmm,项目名称:Hrebenko_DZ,代码行数:56,代码来源:main.c


示例9: QLCDNumber

DigitalClock::DigitalClock(QWidget *parent)
	: QLCDNumber(parent)
{
	ui.setupUi(this);
	setSegmentStyle(Filled);
    QTimer *timer = new QTimer(this);
    QObject::connect(timer, SIGNAL(timeout()), this, SLOT(showTime()));
    timer->start(1000);
    showTime();
    resize(WIDTH_TIMER, HEIGHT_TIMER);
}
开发者ID:cs2103aug2014-t13-1c,项目名称:main,代码行数:11,代码来源:digitalclock.cpp


示例10: QLCDNumber

DigitalClock::DigitalClock(QWidget *parent)
    : QLCDNumber(parent)
{
    setSegmentStyle(Filled);
    setNumDigits(8);
    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(showTime())); 
    timer->start(1000);

    showTime();
    setWindowTitle(tr("Digital Clock"));
    resize(150, 60);
}
开发者ID:panweiping3,项目名称:programming,代码行数:13,代码来源:digitalclock.cpp


示例11: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);


    //sætter billeder på knapper og det's lige. OBS på knapper kan det give et halv dårligt resultat med scaling.
    // brug evt.  ------  border-image: url(/url/to/image);   ------ i stylesheet i stedet.
    //QPixmap selftest_icon(":/icon-self-test.png");
    //QIcon selftest_ButtonIcon(selftest_icon);
    //ui->pushButton_Selftest->setIcon(selftest_ButtonIcon);
    //ui->pushButton_Selftest->setIconSize(selftest_icon.rect().size());

    //sætter status vindue til Read Only
    ui->textEdit->setReadOnly(true);

    //sætter egenskaber for message output området.
    ui->textEdit->setStyleSheet("QTextEdit { background-color: transparent;}");
    ui->textEdit->setTextColor("green");

    // næste tre linjer sørger for at uret bliver opdateret hvert sekund, og er en timer
    QTimer *tidsTimer  = new QTimer(this);
    connect(tidsTimer, SIGNAL(timeout()),this,SLOT(showTime()));
    tidsTimer->start();


}
开发者ID:simoher,项目名称:SemesterProjekt3IHA,代码行数:28,代码来源:MainWindow.cpp


示例12: QLCDNumber

void Sudoku::inicializarCronometro(){

    // Número con digitos tipo LCD
    num = new QLCDNumber();

    // Formato tiempo
    time = new QTime;
    time->setHMS(0,0,0,0);

    // Creamos el temporizador
    timer = new QTimer(this);

    // Realizamos la conexión para que el método(Slot) showTime sea llamado cada segundo
    QObject::connect(timer, SIGNAL(timeout()), this, SLOT(showTime()));

    // Iniciamos los segundos con valor 0
    seconds=0;

    // convertimos el formato tiempo a cadena(horas,min,sec) y le damos estilos (color, fondo)
    QString text = time->toString("hh:mm:ss");
    num->display(text);
    num->setSegmentStyle(QLCDNumber::Filled);

    ui->LayoutCronometro->addWidget(num);

}
开发者ID:josephtk18,项目名称:ProyectoSudoku,代码行数:26,代码来源:sudoku.cpp


示例13: loop

void loop()
{
    uint8_t buf[ VW_MAX_MESSAGE_LEN ];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    showTime();
    if( vw_get_message( buf, &buflen )) // Non-blocking
    {
        //        const char *fieldName  = "";
        buflen = buflen < ( VW_MAX_MESSAGE_LEN - 1)
                                        ? buflen
                                        : VW_MAX_MESSAGE_LEN - 1;
        buf[ buflen ] = '\0';
        String msg(reinterpret_cast<char *>(buf));
        String fieldValue = msg.substring(2);
        Serial.println( msg );
        lcd.setCursor( 0, 1 );
        if( msg.startsWith( "#T" )) {
            lcd.print( "Tmp: " + fieldValue );
        }
        else if( msg.startsWith( "#H" )) {
            lcd.print( "Hmd: " + fieldValue );
        }
        else if( msg.startsWith( "#P" )) {
            lcd.print( "Prs: " + fieldValue );
        }
        else if( msg.startsWith( "#A" )) {
            lcd.print( "Alt: " + fieldValue );
        }
        else if( msg.startsWith( "#L" )) {
            lcd.print( "Lgt: " + fieldValue );
        }
    }
    delay( 1000 );
}
开发者ID:varunamachi,项目名称:MyArduinoProjs,代码行数:35,代码来源:WeatherBase.cpp


示例14: mostraElencoMancanti

void mostraElencoMancanti() {

	char msg[35];
	int k=0,c=0,j=0;
	GUI_DispStringAt( "Nella scatola manca:", 0, 20);

	Nodo_t *temp = listaTagMancanti;
	while (temp!=NULL) {
		for (k=0; k<maxR; k++) {
			uint8_t tempTag[4];
			for (c=0;c<4;c++){
				tempTag[c] = l_tabellaMedicine[k][c];
			}
			if (confronta_tag(temp->info,tempTag)==1) {
				for (c=0;c<35;c++){
					msg[c] = l_tabellaMedicine[k][c+4];
					GUI_DispStringAt(msg, 0, 20*j+40);
				}
				j++;
				break;
			}
		}
		temp = temp->prox;
	}
	showTime();

}
开发者ID:lollofranziPoliMi,项目名称:med-nager,代码行数:27,代码来源:mainGUI.c


示例15: timeLapse

//时间流逝并显示
float GameScene::timeLapseShow(float dt)
{
	float t = timeLapse(dt);
	showTime(t);

	return t;
}
开发者ID:The---onE,项目名称:UNOLink,代码行数:8,代码来源:GameScene.cpp


示例16: switch

int Widget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: mySignal(); break;
        case 1: on_toolButton_List_clicked((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: tableWidget_cellDoubleClicked((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 3: on_toolButton_lrcD_clicked((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 4: on_toolButton_next_clicked(); break;
        case 5: on_toolButton_stop_clicked(); break;
        case 6: on_toolButton_playpause_clicked(); break;
        case 7: on_toolButton_previous_clicked(); break;
        case 8: on_toolButton_open_clicked(); break;
        case 9: showTime((*reinterpret_cast< qint64(*)>(_a[1]))); break;
        case 10: Timeout(); break;
        case 11: musicInformationStateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break;
        case 12: mediaObjectStateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break;
        case 13: musicAboutToFinish(); break;
        case 14: currentMusicSourceChanged((*reinterpret_cast< Phonon::MediaSource(*)>(_a[1]))); break;
        case 15: removeSlot(); break;
        case 16: exitSlot(); break;
        case 17: iconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 18;
    }
    return _id;
}
开发者ID:leenetworks,项目名称:qt,代码行数:31,代码来源:moc_widget.cpp


示例17: showTime

void TimeBar::shiftTimer(int numb)
{
    if (!running) {
        ms = numb;
        showTime();
    }
}
开发者ID:aITy,项目名称:24hoursRace,代码行数:7,代码来源:timebar.cpp


示例18: showTime

void widget::timerEvent(QTimerEvent *event){
    if(event->timerId() == lrcID){
        qint64 curTime = player->position();
        showTime(curTime);

    }
}
开发者ID:UndertakerMouni,项目名称:AtticMusic,代码行数:7,代码来源:widget.cpp


示例19: CHECK_ALLOWED_ERROR

inline
void
CHECK_ALLOWED_ERROR(const char * str, 
		    const ThreadData * td, 
		    const struct NdbError & error){
  
  char buf[100];
  snprintf(buf, sizeof(buf), "subscriber = %.*s ", 
	  SUBSCRIBER_NUMBER_LENGTH, 
	  td->transactionData.number);
  ndbout << str << " " << error << endl
	 << buf;
  showTime();
  
  switch(error.classification) { 
  case NdbError::TimeoutExpired:  
  case NdbError::OverloadError: 
  case NdbError::TemporaryResourceError: 
  case NdbError::NodeRecoveryError:
    break;    
  default:    
    if(error.status != NdbError::TemporaryError)
      exit(-1);
  }
}
开发者ID:0x00xw,项目名称:mysql-2,代码行数:25,代码来源:ndb_error.hpp


示例20: QMainWindow

/**
  *     @brief 建立主視窗跟相關的一些元件
  *
  *     MainWindow的建構子,作為初始化整個視窗的開頭,他先呼叫 ui->setupUi()
  *     把 Qt Designer畫出來的 From給建立起來,再來是呼叫 Boshiamy的建構子
  *     這邊設定Boshiamy的字根對照表是『建議碼』,然後建立計時器跟定時器,把定時
  *     器的 signal跟 MainWindow的函式 void showTime()連接起來。
  *     設定 MainWindow的 Status bar把 status這個 Label給連過去。
  *     設定一些基本常數,清空鍵盤暫存,如果外掛的打字範本不存在就呼叫原始的打字範本
  *     呼叫 drawLayout()完成所有畫圖的工作。
  */
MainWindow::MainWindow(QWidget *parent) :
	QMainWindow(parent),
	ui(new Ui::MainWindow)
{
	ui->setupUi(this);
	check = new Boshiamy();
        check->setStatus(B_Standard);
	timer = new QTimer(this);
	time = new QTime();
	connect( timer,SIGNAL( timeout() ),this,SLOT( showTime() ) );
	status = new QLabel();
	statusBar()->addPermanentWidget(status);
        Col = 9;                                                        ///< 預設每行是 10個;
	Buff = "";
/// 這底下是後來加上去的。
	QString filename = QDir::currentPath() + QDir::separator() + "text.txt";
	QFile file(filename);
	if( file.open(QIODevice::ReadOnly) )
	{
		QTextStream in(&file);
		QString SampleText = in.readAll();
		setText(SampleText);
	}
	else{
		setText(Sample_Text);
	}
	At = 0;
	correct = 0,incorrect = 0,recorrect=0;
	drawLayout();
}
开发者ID:masks62009,项目名称:MadInTyping,代码行数:41,代码来源:mainwindow.cpp



注:本文中的showTime函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ showUsage函数代码示例发布时间:2022-05-30
下一篇:
C++ showStatus函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap