PlayFileInfoEditDialog::PlayFileInfoEditDialog(const TimeIntevalValidator &validator, const QTime& defaultStartTime, QWidget *parent):
    QDialog(parent),
	ui(new Ui::PlayFileInfoEditDialog),
	m_Validator(validator),
	m_IsTimeValid(false),
	m_IsFilePathValid(false)
{
	ui->setupUi(this);
	setupWidgets();
	setModal(true);
	setWindowTitle(tr("请选择要播放的文件跟播放的起始与截止时间"));

	ui->m_StartTimeEdit->setTime(defaultStartTime);
	ui->m_StartTimeEdit->setTime(defaultStartTime);

	connect(ui->m_PlayFileNameEdit, SIGNAL(textChanged(QString)),
			this, SLOT(onPlayFileChanged(QString)));
	connect(ui->m_SelectPlayFileButton, SIGNAL(clicked()),
			this, SLOT(onSelectPlayFileClicked()));
	connect(ui->m_SelectSubFileButton, SIGNAL(clicked()),
			this, SLOT(onSelectSubFileClicked()));
	connect(ui->m_StartTimeEdit, SIGNAL(timeChanged(QTime)),
			this, SLOT(onTimeEditChange()));
	connect(ui->m_EndTimeEdit, SIGNAL(timeChanged(QTime)),
			this, SLOT(onTimeEditChange()));
}
Пример #2
0
EventEditor::EventEditor( const Event& event, QWidget* parent )
    : QDialog( parent )
    , m_ui( new Ui::EventEditor )
    , m_event( event )
{
    m_ui->setupUi( this );
    m_ui->dateEditEnd->calendarWidget()->setFirstDayOfWeek( Qt::Monday );
    m_ui->dateEditEnd->calendarWidget()->setVerticalHeaderFormat( QCalendarWidget::ISOWeekNumbers );
    m_ui->dateEditStart->calendarWidget()->setFirstDayOfWeek( Qt::Monday );
    m_ui->dateEditStart->calendarWidget()->setVerticalHeaderFormat( QCalendarWidget::ISOWeekNumbers );

    // Ctrl+Return for OK
    m_ui->buttonBox->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL + Qt::Key_Return);

    // connect stuff:
    connect( m_ui->spinBoxHours, SIGNAL(valueChanged(int)),
             SLOT(durationHoursEdited(int)) );
    connect( m_ui->spinBoxMinutes, SIGNAL(valueChanged(int)),
             SLOT(durationMinutesEdited(int)) );
    connect( m_ui->dateEditStart, SIGNAL(dateChanged(QDate)),
             SLOT(startDateChanged(QDate)) );
    connect( m_ui->timeEditStart, SIGNAL(timeChanged(QTime)),
             SLOT(startTimeChanged(QTime)) );
    connect( m_ui->dateEditEnd, SIGNAL(dateChanged(QDate)),
             SLOT(endDateChanged(QDate)) );
    connect( m_ui->timeEditEnd, SIGNAL(timeChanged(QTime)),
             SLOT(endTimeChanged(QTime)) );
    connect( m_ui->pushButtonSelectTask, SIGNAL(clicked()),
             SLOT(selectTaskClicked()) );
    connect( m_ui->textEditComment, SIGNAL(textChanged()),
             SLOT(commentChanged()) );
    connect( m_ui->startToNowButton, SIGNAL(clicked()),
             SLOT(startToNowButtonClicked()) );
    connect( m_ui->endToNowButton, SIGNAL(clicked()),
             SLOT(endToNowButtonClicked()) );
    // what a fricking hack - but QDateTimeEdit does not seem to have
    // a simple function to toggle 12h and 24h mode:
    // yeah, I know, this will survive changes in the user prefs, but
    // only for this instance of the edit dialog
    QString originalDateTimeFormat = m_ui->timeEditStart->displayFormat();

    QString format = originalDateTimeFormat
                     .remove( QStringLiteral("ap") )
                     .remove( QStringLiteral("AP") )
                     .simplified();
    m_ui->timeEditStart->setDisplayFormat( format );
    m_ui->timeEditEnd->setDisplayFormat( format );

    // initialize to some sensible values, unless we got something valid passed in
    if ( !m_event.isValid() ) {
        QSettings settings;
        QDateTime start = settings.value( MetaKey_LastEventEditorDateTime, QDateTime::currentDateTime() ).toDateTime();
        m_event.setStartDateTime( start );
        m_event.setEndDateTime( start );
        m_endDateChanged = false;
    }
    updateValues( true );
}
void MainWindow::showSubtitle()
{
	disconnect(m_ui->subtitleTextEdit, SIGNAL(textChanged()), this, SLOT(updateSubtitle()));
	disconnect(m_ui->xPositionSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateSubtitle()));
	disconnect(m_ui->yPositionSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateSubtitle()));
	disconnect(m_ui->beginTimeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(updateSubtitle()));
	disconnect(m_ui->lengthTimeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(updateSubtitle()));

	if (m_currentTrack < 0 || m_currentTrack > 1)
	{
		m_currentTrack = 0;
	}

	if (m_currentSubtitle < 0)
	{
		if (m_subtitles[m_currentTrack].count() > 0)
		{
			m_currentSubtitle = (m_subtitles[m_currentTrack].count() - 1);
		}
		else
		{
			m_currentSubtitle = 0;
		}
	}
	else if (m_currentSubtitle >= m_subtitles[m_currentTrack].count())
	{
		m_currentSubtitle = 0;
	}

	if (m_currentSubtitle < m_subtitles[m_currentTrack].count())
	{
		QTime nullTime(0, 0, 0, 0);

		m_ui->subtitleTextEdit->setPlainText(m_subtitles[m_currentTrack].at(m_currentSubtitle).text);
		m_ui->beginTimeEdit->setTime(nullTime.addMSecs((m_subtitles[m_currentTrack].at(m_currentSubtitle).beginTime * 1000)));
		m_ui->lengthTimeEdit->setTime(nullTime.addMSecs(((m_subtitles[m_currentTrack].at(m_currentSubtitle).endTime * 1000) - (m_subtitles[m_currentTrack].at(m_currentSubtitle).beginTime * 1000))));
		m_ui->xPositionSpinBox->setValue(m_subtitles[m_currentTrack].at(m_currentSubtitle).positionX);
		m_ui->yPositionSpinBox->setValue(m_subtitles[m_currentTrack].at(m_currentSubtitle).positionY);
	}
	else
	{
		m_ui->subtitleTextEdit->clear();
		m_ui->beginTimeEdit->setTime(QTime());
		m_ui->lengthTimeEdit->setTime(QTime());
		m_ui->xPositionSpinBox->setValue(0);
		m_ui->yPositionSpinBox->setValue(0);
	}

	connect(m_ui->subtitleTextEdit, SIGNAL(textChanged()), this, SLOT(updateSubtitle()));
	connect(m_ui->xPositionSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateSubtitle()));
	connect(m_ui->yPositionSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateSubtitle()));
	connect(m_ui->beginTimeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(updateSubtitle()));
	connect(m_ui->lengthTimeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(updateSubtitle()));
}
Пример #4
0
void QTodoClock::handleMouseEvent(QMouseEvent* e)
{
	QPoint v;
	v = e->pos() - QPoint(width()/2,height()/2);

	QPoint b(0,-1);

	double bl = b.manhattanLength();
	double vl = sqrt(pow(v.x(),2)+pow(v.y(),2));

	double z = (double)(v.x()*b.x() + v.y()*b.y())/(bl*vl);
	double za = acos(z);

	int id;
	if(e->button() != NoButton)
		id = e->button();
	else
		id = e->state();

	int s = 0;
	switch(id)
	{
		int h;
		int m;
		case LeftButton:
			if(v.x() < 0)
				h = 12 - int(za*2.);
			else
				h = int(za*2.);
			if(time.hour() > 11)
				h += 12;
			if(h == 24 || (time.hour() < 12 && h == 12))
				--h;	
			setTime(QTime(h,time.minute(),s));
			emit timeChanged(time);
			break;
		case RightButton:
			if(v.x() < 0)
				m = 60 - int(za*10.);
			else
				m = int(za*10.);
			h = time.hour();
			if(m == 60)
			{
				m = 59;
				s = 59;
			}
			setTime(QTime(h,m,s));
			emit timeChanged(time);
			break;
		default:
			break;
	}
}
Пример #5
0
void AudioPlayer::printTime()
{
	sf_count_t frames = 0;
	if(info.sndfile)
	{
		frames = sf_seek (info.sndfile, 0, SEEK_CUR);
		info.seek = frames;
	}
	if(!m_seeking)
		emit timeChanged((int)frames);
	emit timeChanged(calcTimeString((int)frames));
}
void DlgEditMusic::DoInitDialog() {
    ui->SeekLeftBt->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaSkipBackward));
    ui->SeekRightBt->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaSkipForward));
    ui->StartPosEd->setCurrentSection(QDateTimeEdit::MSecSection);  ui->StartPosEd->setCurrentSectionIndex(3);  ui->StartPosEd->MsecStep=1;//MusicObject->GetFPSDuration();
    ui->EndPosEd->setCurrentSection(QDateTimeEdit::MSecSection);    ui->EndPosEd->setCurrentSectionIndex(3);    ui->EndPosEd->MsecStep  =1;//MusicObject->GetFPSDuration();

    Music.SetFPS(double(1000)/ApplicationConfig->PreviewFPS,2,ApplicationConfig->PreviewSamplingRate,AV_SAMPLE_FMT_S16);

    ui->CustomRuler->EditStartEnd =true;
    ui->CustomRuler->setSingleStep(25);

    // Disable all during sound analyse
    ui->CustomRuler->setEnabled(false);
    ui->DefStartPosBT->setEnabled(false);
    ui->DefEndPosBT->setEnabled(false);
    ui->SeekLeftBt->setEnabled(false);
    ui->SeekRightBt->setEnabled(false);
    ui->StartPosEd->setEnabled(false);
    ui->EndPosEd->setEnabled(false);
    ui->VideoPlayerPlayPauseBT->setEnabled(false);

    SetCurrentPos(MusicObject->StartPos);
    RefreshControls();

    connect(&Timer,SIGNAL(timeout()),this,SLOT(s_TimerEvent()));
    connect(ui->VideoPlayerPlayPauseBT,SIGNAL(clicked()),this,SLOT(s_VideoPlayerPlayPauseBT()));

    // Slider controls
    connect(ui->CustomRuler,SIGNAL(sliderPressed()),this,SLOT(s_SliderPressed()));
    connect(ui->CustomRuler,SIGNAL(sliderReleased()),this,SLOT(s_SliderReleased()));
    connect(ui->CustomRuler,SIGNAL(valueChanged(int)),this,SLOT(s_SliderMoved(int)));
    connect(ui->CustomRuler,SIGNAL(PositionChangeByUser()),this,SLOT(s_PositionChangeByUser()));
    connect(ui->CustomRuler,SIGNAL(StartEndChangeByUser()),this,SLOT(s_StartEndChangeByUser()));
    connect(ui->CustomRuler,SIGNAL(StartEndChangeByUser()),this,SLOT(s_StartEndChangeByUser()));

    // Edit controls
    connect(ui->DefStartPosBT,SIGNAL(clicked()),this,SLOT(s_DefStartPos()));
    connect(ui->DefEndPosBT,SIGNAL(clicked()),this,SLOT(s_DefEndPos()));
    connect(ui->SeekLeftBt,SIGNAL(clicked()),this,SLOT(s_SeekLeft()));
    connect(ui->SeekRightBt,SIGNAL(clicked()),this,SLOT(s_SeekRight()));
    connect(ui->StartPosEd,SIGNAL(timeChanged(QTime)),this,SLOT(s_EditStartPos(QTime)));
    connect(ui->EndPosEd,SIGNAL(timeChanged(QTime)),this,SLOT(s_EditEndPos(QTime)));

    audio_outputStream->setBufferSize(MixedMusic.NbrPacketForFPS*MixedMusic.SoundPacketSize*BUFFERING_NBR_AUDIO_FRAME);
    audio_outputDevice=audio_outputStream->start();
    #if QT_VERSION >= 0x050000
    audio_outputStream->setVolume(ApplicationConfig->PreviewSoundVolume);
    #endif
    audio_outputStream->suspend();
}
Пример #7
0
void timelineWidget::mouseMoveEvent( QMouseEvent *event )
    {
    if( _zoomActivated )
        {
        int dir = ( _oldMousePos.x() - event->pos().x() );
        if( dir > 0 )
            {
            timeInView( timeInView() * 1.03 );
            }
        else
            {
            timeInView( timeInView() / 1.03 );
            }
        _oldMousePos = event->pos();
        update();
        }
    else if( _dragActivated )
        {
        viewCentre( viewCentre() + timeInView() * ( (float)( _oldMousePos.x() - event->pos().x() ) / width() ) );
        update();
        _oldMousePos = event->pos();
        }
    else
        {
        setTimeSeconds( ( ( (float)event->x() / width() ) * timeInView() ) + ( viewCentre() - ( timeInView() / 2 ) ) );
        emit timeChanged( _currentTime );
        }
    }
Пример #8
0
DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f)
{
	ui.setupUi(this);
	ui.dateEdit->setDisplayFormat(getDateFormat());
	ui.tableWidget->setTitle(tr("Dive planner points"));
	ui.tableWidget->setModel(DivePlannerPointsModel::instance());
	DivePlannerPointsModel::instance()->setRecalc(true);
	ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::GAS, new AirTypesDelegate(this));
	ui.cylinderTableWidget->setTitle(tr("Available gases"));
	ui.cylinderTableWidget->setModel(CylindersModel::instance());
	QTableView *view = ui.cylinderTableWidget->view();
	view->setColumnHidden(CylindersModel::START, true);
	view->setColumnHidden(CylindersModel::END, true);
	view->setColumnHidden(CylindersModel::DEPTH, false);
	view->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
	connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addCylinder_clicked()));
	connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop()));

	connect(CylindersModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)),
		GasSelectionModel::instance(), SLOT(repopulate()));
	connect(CylindersModel::instance(), SIGNAL(rowsInserted(QModelIndex, int, int)),
		GasSelectionModel::instance(), SLOT(repopulate()));
	connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)),
		GasSelectionModel::instance(), SLOT(repopulate()));
	connect(CylindersModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)),
		plannerModel, SIGNAL(cylinderModelEdited()));
	connect(CylindersModel::instance(), SIGNAL(rowsInserted(QModelIndex, int, int)),
		plannerModel, SIGNAL(cylinderModelEdited()));
	connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)),
		plannerModel, SIGNAL(cylinderModelEdited()));

	ui.tableWidget->setBtnToolTip(tr("Add dive data point"));
	connect(ui.startTime, SIGNAL(timeChanged(QTime)), plannerModel, SLOT(setStartTime(QTime)));
	connect(ui.dateEdit, SIGNAL(dateChanged(QDate)), plannerModel, SLOT(setStartDate(QDate)));
	connect(ui.ATMPressure, SIGNAL(valueChanged(int)), this, SLOT(atmPressureChanged(int)));
	connect(ui.atmHeight, SIGNAL(valueChanged(int)), this, SLOT(heightChanged(int)));
	connect(ui.salinity, SIGNAL(valueChanged(double)), this, SLOT(salinityChanged(double)));
	connect(DivePlannerPointsModel::instance(), SIGNAL(startTimeChanged(QDateTime)), this, SLOT(setupStartTime(QDateTime)));

	// Creating (and canceling) the plan
	replanButton = ui.buttonBox->addButton(tr("Save new"), QDialogButtonBox::ActionRole);
	connect(replanButton, SIGNAL(clicked()), plannerModel, SLOT(saveDuplicatePlan()));
	connect(ui.buttonBox, SIGNAL(accepted()), plannerModel, SLOT(savePlan()));
	connect(ui.buttonBox, SIGNAL(rejected()), plannerModel, SLOT(cancelPlan()));
	QShortcut *closeKey = new QShortcut(QKeySequence(Qt::Key_Escape), this);
	connect(closeKey, SIGNAL(activated()), plannerModel, SLOT(cancelPlan()));

	// This makes shure the spinbox gets a setMinimum(0) on it so we can't have negative time or depth.
	ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::DEPTH, new SpinBoxDelegate(0, INT_MAX, 1, this));
	ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::RUNTIME, new SpinBoxDelegate(0, INT_MAX, 1, this));
	ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::DURATION, new SpinBoxDelegate(0, INT_MAX, 1, this));
	ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::CCSETPOINT, new DoubleSpinBoxDelegate(0, 2, 0.1, this));

	/* set defaults. */
	ui.ATMPressure->setValue(1013);
	ui.atmHeight->setValue(0);

	setMinimumWidth(0);
	setMinimumHeight(0);
}
Пример #9
0
TopicRow::TopicRow(QWidget *parent)
    : QWidget(parent)
{
    
    QHBoxLayout *layout = new QHBoxLayout;
    
    m_titleEdit = new KLineEdit(this);
    m_iconButton = new KIconButton(this);
    m_durationEdit = new QTimeEdit(this);
    
    m_titleEdit->setText(i18n("Untitled"));
    m_iconButton->setIcon("dialog-information");
    m_durationEdit->setDisplayFormat("hh:mm:ss");
    
    m_iconButton->setIconSize(KIconLoader::SizeMedium);
    
    layout->addWidget(m_titleEdit);
    layout->addWidget(m_iconButton);
    layout->addWidget(m_durationEdit);
    
    setLayout(layout);

    
    connect(m_durationEdit, SIGNAL(timeChanged(QTime)), this, SIGNAL(changed()));
    connect(m_iconButton, SIGNAL(iconChanged(QString)), this, SIGNAL(changed()));
    connect(m_titleEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed()));

}
Пример #10
0
void VorbitalDlg::UpdateTime()
{
    QDateTime currTime = QDateTime::currentDateTime();
    _timeElapsed += _lastTimeUpdate.secsTo(currTime);
    _lastTimeUpdate = currTime;
    emit timeChanged(_timeElapsed);
}
Пример #11
0
void IdlerTimeBase::useIdleTime() {
	uint32 currentTime = getTime();
	if (currentTime != _lastTime) {
		_lastTime = currentTime;
		timeChanged(_lastTime);
	}
}
Пример #12
0
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);
}
Пример #13
0
void KTimeEdit::addTime(QTime qt)
{
    // Calculate the new time.
    mTime = qt.addSecs(mTime.minute() * 60 + mTime.hour() * 3600);
    updateText();
    emit timeChanged(mTime);
}
WidgetNetworkTimer::WidgetNetworkTimer(QWidget *parent)
    : QWidget(parent)
{
    InitUI();
    timer=new QTimer(this);
    timer_count=new QTimer(this);
    connect(timer,&QTimer::timeout,this,&WidgetNetworkTimer::TimerNetExec );
    connect(timer_count,&QTimer::timeout,this,&WidgetNetworkTimer::TimerCountExec);
    connect(checkbox_get_inf,&QCheckBox::stateChanged,this,&WidgetNetworkTimer::slot_check_inf);
    connect(checkbox_count,&QCheckBox::stateChanged,this,&WidgetNetworkTimer::slot_check_count);
    connect(combo_net_count,SIGNAL(currentIndexChanged(int)),this,SLOT(slot_cnc_index_changed(int)));
    connect(combo_net_power,SIGNAL(currentIndexChanged(int)),this,SLOT(slot_cnp_index_changed(int)));
    connect(te_count,SIGNAL(timeChanged(QTime)),this,SLOT(slot_tepow_timechanged(QTime )));
    connect(spin_net_va,SIGNAL(valueChanged(int)),this,SLOT(slot_sinpow_changed(int)));
    connect(button_update,SIGNAL(clicked()),this,SLOT(slot_button_update_click()));
    net_manager->updateConfigurations();
    this->setStyleSheet( "QGroupBox { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #E0E0E0, stop: 1 #FFFFFF);"
                         "border: 2px solid gray;border-radius: 5px;margin-top: 1ex;}   "
                         "QGroupBox::title {subcontrol-origin: margin;subcontrol-position: top left; padding: 0 3px;"
                         "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #E0E0E0, stop: 1 #FFFFFF); }");

    this->current_receive_value=0;
    this->current_transmit_value=0;
    checkbox_count->stateChanged(0);
    checkbox_count->setTristate(0);
    checkbox_get_inf->stateChanged(0);
    checkbox_get_inf->setTristate(0);
}
Пример #15
0
void qtractorTimeScaleForm::refresh (void)
{
	refreshItems();
	timeChanged(frame());

	m_iDirtyCount = 0;
}
Пример #16
0
Event::Event(Task* parent): Model(parent)
{
    initialize<Event, EventAdaptor>();
    setTaskId(parent->id());

    connect (this, SIGNAL(timeChanged()), SLOT(updateDuration()));
}
Пример #17
0
MainWindow::MainWindow()
{
        setWindowTitle( tr( "TWEEDY - Stop Motion software" ) );

	createActions();
	createStartWindow();
	createMenuBar();
	createToolBar();
	createWidgets();
	createStatusBar();

        _isPlaying = false;
        _timer = new QTimer( this );
        _fps = 8;
        _time = 0;
        

        connect( this, SIGNAL( timeChanged( int ) ), this->_viewerImg, SLOT( displayChanged( int ) ) );
        connect( &( this->_timelineGraphic->getTimelineDataWrapper() ), SIGNAL( timeChanged( int ) ), this->_viewerImg, SLOT( displayChanged( int ) ) );
        connect( &(this->_timelineGraphic->getTimelineDataWrapper()), SIGNAL( displayChanged( int, int ) ), _chutier, SLOT( changedPixmap( int, int ) ) );
        connect( _timer, SIGNAL( timeout() ), this, SLOT( increaseTime() ) );
        connect( &(this->_timelineGraphic->getTimelineDataWrapper()), SIGNAL( timeChanged( int )), this, SLOT( changeTimeViewer( int ) ) );
        connect( this, SIGNAL(timeChanged(int)), &(this->_timelineGraphic->getTimelineDataWrapper()), SLOT(time(int)) );

	this->adjustSize();

        Q_EMIT timeChanged( _time );
        _timelineGraphic->getTimelineDataWrapper()._currentTime = _time;
        
        QSettings settings("IMAC","Tweedy");     
}
void MediaPlayerPrivate::didEnd()
{
    printf("MediaPlayerPrivate::didEnd\n");
    m_isEndReached = true;
    pause();
    timeChanged();
}
Пример #19
0
void MyType::setTimeText(const QString &text)
{
    if (m_timeText != text) {
        m_timeText = text;
        emit timeChanged(m_timeText);
    }
}
void QmlProfilerTraceTime::increaseEndTime(qint64 time)
{
    if (m_endTime < time) {
        m_endTime = time;
        emit timeChanged(m_startTime, time);
    }
}
Пример #21
0
void PhClock::setTime(qint64 time)
{
    if (_time != time) {
        _time = time;
        emit timeChanged(time);
    }
}
void QmlProfilerTraceTime::decreaseStartTime(qint64 time)
{
    if (m_startTime > time) {
        m_startTime = time;
        emit timeChanged(time, m_endTime);
    }
}
Пример #23
0
//--------------------------------------------
IntervalEditImpl::IntervalEditImpl(QWidget *parent)
    : IntervalEditBase(parent) 
{
    intervalList->setColumnCount( 2 );
    QStringList lst;
    lst << i18nc( "Interval start time", "Start" )
        << i18nc( "Interval length", "Length" );
    intervalList->setHeaderLabels( lst );

    intervalList->setRootIsDecorated( false );
    intervalList->setSortingEnabled( true );
    intervalList->sortByColumn( 0, Qt::AscendingOrder );

    bAddInterval->setIcon(koIcon("list-add"));
    bRemoveInterval->setIcon(koIcon("list-remove"));
    bClear->setIcon(koIcon("edit-clear-list"));

    connect(bClear, SIGNAL(clicked()), SLOT(slotClearClicked()));
    connect(bAddInterval, SIGNAL(clicked()), SLOT(slotAddIntervalClicked()));
    connect(bRemoveInterval, SIGNAL(clicked()), SLOT(slotRemoveIntervalClicked()));
    connect(intervalList, SIGNAL(itemSelectionChanged()), SLOT(slotIntervalSelectionChanged()));
    
    connect( startTime, SIGNAL(timeChanged(QTime)), SLOT(enableButtons()) );
    connect( length, SIGNAL(valueChanged(double)), SLOT(enableButtons()) );
    
}
Пример #24
0
void WaveView::viewMouseMoveEvent(QMouseEvent* event)
      {
      unsigned x = event->x();
      emit timeChanged(x);

      int i;
      switch (button) {
            case Qt::LeftButton:
                  i = 0;
                  if (mode == DRAG) {
                        if (x < dragstartx) {
                              selectionStart = x;
                              selectionStop = dragstartx;
                              }
                        else {
                              selectionStart = dragstartx;
                              selectionStop = x;
                              }
                        }
                  break;
            case Qt::MidButton:
                  i = 1;
                  break;
            case Qt::RightButton:
                  if ((MusEGlobal::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier))
                      i = 1;
                  else
                      i = 2;
                  break;
            default:
                  return;
            }
      MusECore::Pos p(MusEGlobal::tempomap.frame2tick(x), true);
      MusEGlobal::song->setPos(i, p);
      }
Пример #25
0
void SigScale::viewMousePressEvent(QMouseEvent* event)/*{{{*/
{
    button = event->button();
    //viewMouseMoveEvent(event);
    int x = sigmap.raster(event->x(), *raster);
    emit timeChanged(x);
    pos[3] = x;
    int i;
    switch (button)
    {
        case Qt::LeftButton:
            i = 0;
            pos[0] = x;
            break;
        case Qt::MidButton:
            i = 1;
            pos[1] = x;
            break;
        case Qt::RightButton:
            i = 2;
            pos[2] = x;
            break;
        default:
            pos[3] = x;
            redraw();
            return;
    }
    Pos p(x, true);
    song->setPos(i, p);
    redraw();
}/*}}}*/
PreferencesDialog::PreferencesDialog(QWidget *parent) :
    QDialog(parent, Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint),
    ui(new Ui::PreferencesDialog),
    mTableWorkingHours(NULL)
{
    ui->setupUi(this);
    mTableWorkingHours = ui->tableViewWorkingHours;
    
    ui->lineEditUserName->setText(Misc::getUserName());
    ui->lineEditRealName->setText(TimeTrackingSettings::getInstance()->getPrintingRealName());
    ui->checkBoxDisplayImage->setChecked(TimeTrackingSettings::getInstance()->getPrintingShowPicture());
    ui->textEditFooter->setText(TimeTrackingSettings::getInstance()->getPrintingFooter());

    ui->checkBoxEnableDefaultActions->setCheckState(
                TimeTrackingSettings::getInstance()->getEnablePeriodDefaultAction() ? Qt::Checked : Qt::Unchecked);
    ui->timeEditDefaultAction->setTime(TimeTrackingSettings::getInstance()->getPeriodDefaultAction());
    connect(ui->timeEditDefaultAction, SIGNAL(timeChanged(QTime)),
            this, SLOT(onTimeChangedDefaultAction(QTime)));
    connect(ui->checkBoxEnableDefaultActions, SIGNAL(stateChanged(int)),
            this, SLOT(onStateChangedDefaultAction(int)));

    ui->checkBoxRemindPauseTime->setCheckState(
                TimeTrackingSettings::getInstance()->getEnablePeriodPauseTime() ? Qt::Checked : Qt::Unchecked);
    ui->timeEditRemindPauseTime->setTime(TimeTrackingSettings::getInstance()->getPeriodPauseTime());
    connect(ui->timeEditRemindPauseTime, SIGNAL(timeChanged(QTime)),
            this, SLOT(onTimeChangedPauseTime(QTime)));
    connect(ui->checkBoxRemindPauseTime, SIGNAL(stateChanged(int)),
            this, SLOT(onStateChangedPauseTime(int)));

    connect(ui->pushButtonAddAction,     SIGNAL(clicked()),
            this, SLOT(onAddAction()));
    connect(ui->pushButtonDeleteAction,  SIGNAL(clicked()),
            this, SLOT(onDeleteAction()));
    connect(ui->tableWidgetActions->selectionModel(),  SIGNAL(currentChanged(const QModelIndex &,const QModelIndex &)),
            this, SLOT(onTableActionSelectionChanged(const QModelIndex &, const QModelIndex &)));

    connect(ui->labelWhatIsThis, SIGNAL(clicked()),
            this, SLOT(onWhatIsThis()));

    ui->OKButton->setImagesPath(ClickableImage::mNotSelectedOKButton, ClickableImage::mSelectedOKButtonDefault);
    connect(ui->OKButton, SIGNAL(clicked()),
            this, SLOT(onOK()));

    setAttribute(Qt::WA_TranslucentBackground);

    init();
}
void AlarmObject::setMinute(int minute)
{
    if (m_minute == minute)
        return;

    m_minute = minute;
    emit timeChanged();
}
void AlarmObject::setHour(int hour)
{
    if (m_hour == hour)
        return;

    m_hour = hour;
    emit timeChanged();
}
Пример #29
0
void QTimerInfoList::repairTimersIfNeeded()
{
    if (useMonotonicTimers)
        return;
    timeval delta;
    if (timeChanged(&delta))
        timerRepair(delta);
}
Пример #30
0
void QTimerInfoList::repairTimersIfNeeded()
{
    if (qt_gettime_is_monotonic())
        return;
    timeval delta;
    if (timeChanged(&delta))
        timerRepair(delta);
}