本文整理汇总了C++中showTime函数的典型用法代码示例。如果您正苦于以下问题:C++ showTime函数的具体用法?C++ showTime怎么用?C++ showTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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 );
}
示例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();
}
示例15: timeLapse
//时间流逝并显示
float GameScene::timeLapseShow(float dt)
{
float t = timeLapse(dt);
showTime(t);
return t;
}