Clear selection duration correctly

This commit is contained in:
Mark Watkins 2014-07-20 19:26:59 +10:00
parent 0bf8d8833a
commit bf591e22e1
3 changed files with 6 additions and 3 deletions

View File

@ -851,6 +851,8 @@ void gGraph::mouseReleaseEvent(QMouseEvent *event)
int y2 = m_graphview->pointClicked().y() - m_rect.top(); int y2 = m_graphview->pointClicked().y() - m_rect.top();
m_selDurString = QString();
//qDebug() << m_title << "Released" << min_x << max_x << x << y << x2 << y2 << left << right << top << bottom << m_width << m_height; //qDebug() << m_title << "Released" << min_x << max_x << x << y << x2 << y2 << left << right << top << bottom << m_width << m_height;
if (m_selecting_area) { if (m_selecting_area) {
m_selecting_area = false; m_selecting_area = false;

View File

@ -1590,10 +1590,12 @@ void gGraphView::keyReleaseEvent(QKeyEvent *event)
{ {
if (m_metaselect && !(event->modifiers() & Qt::AltModifier)) { if (m_metaselect && !(event->modifiers() & Qt::AltModifier)) {
QMouseEvent mevent(QEvent::MouseButtonRelease, m_point_released, Qt::LeftButton, Qt::LeftButton, event->modifiers()); QMouseEvent mevent(QEvent::MouseButtonRelease, m_point_released, Qt::LeftButton, Qt::LeftButton, event->modifiers());
if (m_graph_index>=0) if (m_graph_index>=0) {
m_graphs[m_graph_index]->mouseReleaseEvent(&mevent); m_graphs[m_graph_index]->mouseReleaseEvent(&mevent);
}
m_metaselect = false; m_metaselect = false;
timedRedraw(50); timedRedraw(50);
} }
if (event->key() == Qt::Key_Escape) { if (event->key() == Qt::Key_Escape) {

View File

@ -347,8 +347,7 @@ void gLineOverlaySummary::paint(QPainter &painter, gGraph &w, const QRegion &reg
QString a; QString a;
if (w.graphView()->selectionInProgress() || w.graphView()->metaSelect()) { if ((w.graphView()->selectionInProgress() || w.graphView()->metaSelect()) && (!w.selDurString().isEmpty())) {
a = QObject::tr("Duration")+": "+w.selDurString(); a = QObject::tr("Duration")+": "+w.selDurString();
} else { } else {