Exemple #1
0
void Plot::mouseClick (int button, QPoint p)
{
  if (! g_symbol)
    return;

  if (_plotSettings.selected)
  {
    _plotSettings.selected->click(_plotSettings.status, button, p);
    return;
  }
    
  QHashIterator<QString, Marker *> it(_plotSettings.markers);
  while (it.hasNext())
  {
    it.next();
    Marker *co = it.value();
    
    if (co->readOnly())
      continue;

    if (! co->isSelected(p))
      continue;

    _plotSettings.selected = co;
    _plotSettings.selected->click(_plotSettings.status, button, p);
    return;
  }
}
Exemple #2
0
void
PlotWidget::saveMarkers (DataBase &db)
{
  // save plot markers
  QHashIterator<QString, Plot *> pit(_plots);
  while (pit.hasNext())
  {
    pit.next();
    Plot *p = pit.value();
    
    QHash<QString, Marker *> markers = p->markers();
    QHashIterator<QString, Marker *> mit(markers);
    while (mit.hasNext())
    {
      mit.next();
      Marker *m = mit.value();
    
      if (m->readOnly())
        continue;
      
      if (! m->modified())
        continue;
      
      Entity *e = m->settings();
      e->setName(mit.key());
      
      db.transaction();
      db.set(e);
      db.commit();
      
      m->setModified(FALSE);
    }
  }
}
Exemple #3
0
void Plot::deleteAllMarkers ()
{
  QStringList dl;
  QHashIterator<QString, Marker *> it(_plotSettings.markers);
  while (it.hasNext())
  {
    it.next();
    Marker *co = it.value();

    if (co->readOnly())
      continue;

    delete co;
    
    dl << it.key();
    
    _plotSettings.markers.remove(it.key());
  }
  
  emit signalDeleteMarkers(dl);

  setHighLow();
  replot();
}