当前位置: 首页>>代码示例>>C++>>正文


C++ QTime::minute方法代码示例

本文整理汇总了C++中QTime::minute方法的典型用法代码示例。如果您正苦于以下问题:C++ QTime::minute方法的具体用法?C++ QTime::minute怎么用?C++ QTime::minute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTime的用法示例。


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

示例1: updatePrimitives

/*!
    @copydoc HbWidget::updatePrimitives()
 */
void SnsrOledClockWidget::updatePrimitives()
{
    if (!mClockHourHand || !mClockMinuteHand || !mClockAmPmLabel) {
        createPrimitives();
    }
    Q_ASSERT( mClockHourHand && mClockMinuteHand && mClockAmPmLabel );
    
    // Calculate angles for clock hands.
    // Use granularity of one minute so that minute hand is always exactly
    // on some minute and not between minutes. OLED clock is not updated more
    // frequently than once per minute and using finer granularity would cause
    // the minute hand to be always between even minutes.
    QTime time = QTime::currentTime();
    qreal m = 6 * time.minute();
    qreal h = 30 * ((time.hour() % 12) + m/360);
    
    int x = mClockHourHand->preferredSize().width()/2;
    int y = mClockHourHand->preferredSize().height()/2;
    mClockHourHand->setTransform(QTransform().translate(x, y).rotate(h).translate(-x, -y));

    x = mClockMinuteHand->preferredSize().width()/2;
    y = mClockMinuteHand->preferredSize().height()/2;
    mClockMinuteHand->setTransform(QTransform().translate(x, y).rotate(m).translate(-x, -y));

    QString amPmString = (time.hour()<12) ? HbExtendedLocale().amText() : HbExtendedLocale().pmText();
    mClockAmPmLabel->setText( amPmString );
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:30,代码来源:snsroledclockwidget.cpp

示例2: QDateTimeToDATE

static DATE QDateTimeToDATE(const QDateTime &dt)
{
    if (!dt.isValid() || dt.isNull())
        return 949998;
    
    SYSTEMTIME stime;
    memset(&stime, 0, sizeof(stime));
    QDate date = dt.date();
    QTime time = dt.time();
    if (date.isValid() && !date.isNull()) {
        stime.wDay = date.day();
        stime.wMonth = date.month();
        stime.wYear = date.year();
    }
    if (time.isValid() && !time.isNull()) {
        stime.wMilliseconds = time.msec();
        stime.wSecond = time.second();
        stime.wMinute = time.minute();
        stime.wHour = time.hour();
    }
    
    double vtime;
    SystemTimeToVariantTime(&stime, &vtime);
    
    return vtime;
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:26,代码来源:qaxtypes.cpp

示例3: setInterval

void Timelapse::setInterval(const QTime &time){
    intervalTime->setHMS(time.hour(),time.minute(),time.second(),time.msec());
    realinterval = interval = time.second()*1000+time.msec();
    LOG_TIMELAPSE_DEBUG << "Timelapse setInterval: " << time.second()  << time.msec() << interval;

    timer->setInterval(timerresolution);
}
开发者ID:klangobjekte,项目名称:CameraRemote,代码行数:7,代码来源:timelapse.cpp

示例4: paintSection

void QxtScheduleHeaderWidget::paintSection(QPainter * painter, const QRect & rect, int logicalIndex) const
{
    if (model())
    {
        switch (orientation())
        {
        case Qt::Horizontal:
        {
            QHeaderView::paintSection(painter, rect, logicalIndex);
        }
        break;
        case Qt::Vertical:
        {
            QTime time = model()->headerData(logicalIndex, Qt::Vertical, Qt::DisplayRole).toTime();
            if (time.isValid())
            {
                QRect temp = rect;
                temp.adjust(1, 1, -1, -1);

                painter->fillRect(rect, this->palette().background());

                if (time.minute() == 0)
                {
                    painter->drawLine(temp.topLeft() + QPoint(temp.width() / 3, 0), temp.topRight());
                    painter->drawText(temp, Qt::AlignTop | Qt::AlignRight, time.toString("hh:mm"));
                }
            }
        }
        break;
        default:
            Q_ASSERT(false); //this will never happen... normally
        }
    }
}
开发者ID:beneon,项目名称:MITK,代码行数:34,代码来源:qxtscheduleheaderwidget.cpp

示例5: timeToMins

int SessionDefaults::timeToMins(const QTime &time) const
{
    int hour = time.hour();
    int min = time.minute();

    return hour * 60 + min + 1;
}
开发者ID:HxCory,项目名称:f1lt,代码行数:7,代码来源:sessiondefaults.cpp

示例6: sipNoMethod

static PyObject *meth_QTime_toPyTime(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        QTime *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QTime, &sipCpp))
        {
            PyObject * sipRes = 0;

#line 299 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qdatetime.sip"
        if (!PyDateTimeAPI)
            PyDateTime_IMPORT;
        
        // Convert to a Python time object.
        sipRes = PyTime_FromTime(sipCpp->hour(), sipCpp->minute(), sipCpp->second(), sipCpp->msec() * 1000);
#line 74 "sipQtCoreQTime.cpp"

            return sipRes;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QTime, sipName_toPyTime, NULL);

    return NULL;
}
开发者ID:ClydeMojura,项目名称:android-python27,代码行数:28,代码来源:sipQtCoreQTime.cpp

示例7: handleSliderMove

void TourWidget::handleSliderMove( int value )
{
    d->m_playback.seek( value / 100.0 );
    QTime nullTime( 0, 0, 0 );
    QTime time = nullTime.addSecs(  value / 100.0 );
    d->m_tourUi.m_elapsedTime->setText( QString("%L1:%L2").arg( time.minute(), 2, 10, QChar('0') ).arg( time.second(), 2, 10, QChar('0') ) );
}
开发者ID:quannt24,项目名称:marble,代码行数:7,代码来源:TourWidget.cpp

示例8: subTime

void KTimeEdit::subTime(QTime qt)
{
    int h, m;

    // Note that we cannot use the same method for determining the new
    // time as we did in addTime, because QTime does not handle adding
    // negative seconds well at all.
    h = mTime.hour() - qt.hour();
    m = mTime.minute() - qt.minute();

    if(m < 0)
    {
        m += 60;
        h -= 1;
    }

    if(h < 0)
    {
        h += 24;
    }

    // store the newly calculated time.
    mTime.setHMS(h, m, 0);
    updateText();
    emit timeChanged(mTime);
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:26,代码来源:ktimeedit.cpp

示例9: addLineToAdvTranscript

void cTranscript::addLineToAdvTranscript (cTextChunk *chunk)
{
  if (!advrunning)
    return;
  
  QString timestamp;
  if (includetimestamp)
  {
    QTime time = QTime::currentTime ();
    timestamp.sprintf ("[%02d:%02d:%02d.%02d] ", time.hour(), time.minute(), time.second(), time.msec() / 10);
    fputs (timestamp.toLatin1(), advfile);
  }
 
  cANSIParser *ap = dynamic_cast<cANSIParser *>(object ("ansiparser"));
  QString s;
  switch (advtype) {
    case TRANSCRIPT_PLAIN: s = chunk->toText (); break;
    case TRANSCRIPT_ANSI: s = chunk->toAnsi (ap); break;
    case TRANSCRIPT_HTML: s = chunk->toHTML (); break;
  };
  QByteArray b = s.toLocal8Bit ();
  const char *ch = b.constData();
  if (ch)
    fputs (ch, advfile);
  
  fflush (advfile);
}
开发者ID:FractalBobz,项目名称:kmuddy,代码行数:27,代码来源:ctranscript.cpp

示例10: QTime

int Tano::Xmltv::timeZoneDiff()
{
    QDateTime local = QDateTime::currentDateTime();
    local.setTime(QTime(0, 0));
    QDateTime utc = local.toUTC();
    local.setTimeSpec(Qt::LocalTime);
    QDateTime offset = local.toUTC();
    QTime properTimeOffset = QTime(offset.time().hour(), offset.time().minute());
    offset.setTimeSpec(Qt::LocalTime);
    utc.setTimeSpec(Qt::UTC);

    bool isNegative;
    if (offset.secsTo(utc) < 0) {
        isNegative = true;
    } else {
        isNegative = false;
        properTimeOffset.setHMS(24 - properTimeOffset.hour() - (properTimeOffset.minute()/60.0) - (properTimeOffset.second()/3600.0), properTimeOffset.minute() - (properTimeOffset.second()/60.0), properTimeOffset.second());
        if (!properTimeOffset.isValid()) { //Midnight case
            properTimeOffset.setHMS(0,0,0);
        }
    }

    if (isNegative)
        return properTimeOffset.secsTo(QTime(0, 0));
    else
        return - properTimeOffset.secsTo(QTime(0, 0));
}
开发者ID:ntadej,项目名称:tano,代码行数:27,代码来源:XmltvCommon.cpp

示例11: setModelData

void TrackDelegate::setModelData(QWidget *editor,
                                 QAbstractItemModel *model,
                                 const QModelIndex &index) const
{
    if ( !index.isValid())
    {
        return;
    }

    QTimeEdit* timeEditor = qobject_cast<QTimeEdit*>(editor);

    if ( !timeEditor)
    {
        return;
    }

    if (isRightColumn(index, TrackDelegate::columnNumber))
    {
        QTime time = timeEditor->time();
        int secs = time.hour() * 60 + time.minute();
        //int secs = index.model()->data(index, Qt::EditRole).toInt();
        model->setData(index, secs, Qt::EditRole);
    }
    else
    {
        QStyledItemDelegate::setModelData(editor, model, index);
    }
}
开发者ID:Iownnoname,项目名称:qt,代码行数:28,代码来源:trackdelegate.cpp

示例12: updateTimer

void MainWindow::updateTimer()
{
    int milisegundos, segundos, minutos;
    QTime timeAct = QTime::currentTime();
    int minInicial = timeInicial.minute();
    int minActual = timeAct.minute();
    int segInicial =  timeInicial.second();
    int segActual = timeAct.second();
    int msegInicial = timeInicial.msec();
    int msegActual = timeAct.msec();

    if (msegActual < msegInicial){
        msegActual = 1000 + msegActual;
        segActual = segActual -1;
    }

    if (segActual < segInicial){
        segActual = 60 + segActual;
        minActual = minActual -1;
    }

    minutos = minActual - minInicial;
    segundos = segActual - segInicial;
    milisegundos = (msegActual - msegInicial);

    QTime *time = new QTime(0,minutos,segundos,milisegundos);
    textTiempo = time->toString("mm:ss.zzz");

    valorTiempo = milisegundos + segundos*1000 + minutos *60000;

    ui->lcdNumber->display(textTiempo);
}
开发者ID:mansrz,项目名称:Sudoku,代码行数:32,代码来源:mainwindow.cpp

示例13: timeValueChanged

// -------------------------------------------------------------------------------------------------
void ParameterBox::timeValueChanged(const QTime& time)
    throw ()
{
    Settings& set = Settings::set();
    set.writeEntry("Measuring/Triggering/Minutes", time.minute());
    set.writeEntry("Measuring/Triggering/Seconds", time.second());
}
开发者ID:BackupTheBerlios,项目名称:tfla-01-svn,代码行数:8,代码来源:parameterbox.cpp

示例14: log

/*
	Log to the logfile only.
 */
void cLog::log( eLogLevel loglevel, cUOSocket* sock, const QString& string, bool timestamp )
{
	if ( !( Config::instance()->logMask() & loglevel ) )
	{
		return;
	}

	// -> Log Event
	cPythonScript *globalHook = ScriptManager::instance()->getGlobalHook(EVENT_LOG);
	if (globalHook && globalHook->canHandleEvent(EVENT_LOG)) {
		PyObject *args = Py_BuildValue("(iNNO)", (unsigned int)loglevel, PyGetSocketObject(sock), QString2Python(string), Py_None );
		bool result = globalHook->callEventHandler(EVENT_LOG, args);
		Py_DECREF(args);

		if (result) {
			return;
		}
	}

	if ( !checkLogFile() )
		return;

	// Timestamp the data
	QTime now = QTime::currentTime();

	QString prelude;

	if ( timestamp || loglevel == LOG_PYTHON )
	{
		prelude.sprintf( "%02u:%02u:", now.hour(), now.minute() );

		if ( sock )
			prelude.append( QString( "%1:" ).arg( sock->uniqueId(), 0, 16 ) );
	}

	// LogLevel
	switch ( loglevel )
	{
	case LOG_ERROR:
		prelude.append( " ERROR: " );
		break;

	case LOG_WARNING:
		prelude.append( " WARNING: " );
		break;

	case LOG_PYTHON:
		prelude.append( " PYTHON: " );
		break;

	default:
		prelude.append( " " );
	}

	QByteArray utfdata = string.toUtf8();
	utfdata.prepend( prelude.toUtf8() );

	logfile.write( utfdata );
	logfile.flush();
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:63,代码来源:log.cpp

示例15: absolutetime_changed

void UI_JumpMenuDialog::absolutetime_changed(const QTime &time_2)
{
  long long milliseconds;

  if(!mainwindow->files_open)  return;

  QObject::disconnect(daybox1,     SIGNAL(valueChanged(int)),          this,        SLOT(offsetday_changed(int)));
  QObject::disconnect(timeEdit1,   SIGNAL(timeChanged(const QTime &)), this,        SLOT(offsettime_changed(const QTime &)));

  milliseconds = (long long)(time_2.hour()) * 3600000LL;
  milliseconds += (long long)(time_2.minute()) * 60000LL;
  milliseconds += (long long)(time_2.second()) * 1000LL;
  milliseconds += (long long)(time_2.msec());

  milliseconds += ((long long)daybox2->value() * 86400000LL);

  if(milliseconds<0)  milliseconds = 0;

  milliseconds -= starttime;

  time1.setHMS((int)((milliseconds / 3600000LL) % 24LL), (int)((milliseconds % 3600000LL) / 60000LL), (int)((milliseconds % 60000LL) / 1000LL), (int)(milliseconds % 1000LL));

  timeEdit1->setTime(time1);

  daybox1->setValue((int)(milliseconds / 86400000LL));

  QObject::connect(daybox1,     SIGNAL(valueChanged(int)),          this,        SLOT(offsetday_changed(int)));
  QObject::connect(timeEdit1,   SIGNAL(timeChanged(const QTime &)), this,        SLOT(offsettime_changed(const QTime &)));
}
开发者ID:RTMilliken,项目名称:EDFbrowser,代码行数:29,代码来源:jump_dialog.cpp


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