void MessageTopicComboBox::setCurrentTopic(const QString& topic) {
  if (topic != currentTopic_) {
    currentTopic_ = topic;
    
    int index = findText(topic);
    
    if (index < 0)
      setEditText(topic);
    else
      setCurrentIndex(index);
    
    emit currentTopicChanged(topic);
  }
}
Ejemplo n.º 2
0
Timeline::Timeline(QWidget *parent)
    : QWidget(parent)
{

    m_timer = new QTimer(this);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(updateTime()));

    setupUi(this);

    connect(topicWidget, SIGNAL(topicChanged(RecordItNow::Topic)), this,
            SLOT(topicChanged(RecordItNow::Topic)));
    connect(topicWidget, SIGNAL(durationChanged(ulong)), this, SLOT(durationChanged(ulong)));
    connect(topicWidget, SIGNAL(topicChanged(RecordItNow::Topic)), this,
            SIGNAL(currentTopicChanged(RecordItNow::Topic)));

    slider->setMaximum(0);
    resetSlider();
    setState(Idle);

}