Several minor issues (#8948)

* #8947 Plot Template : Split export dialog into file path and name
* #8946  Update multi plot title when curve is appended by copy/paste
* #8946 Separate axis object name and axis title text
* If multi plot auto name is empty, use plot title "Plot N"
* QwtPlotWidget: Double click activates Zoom All
* More testing on valid main window before use
* Return false if event is not handeled
* Improve fallback plot name
* Tree View Editor: Early exit if selected object is unchanged
Resetting selection causes flickering
* Summary Plot : Select curve object in project tree when clicking on curve
This commit is contained in:
Magne Sjaastad
2022-05-24 15:24:38 +02:00
committed by GitHub
parent 1aa41968a5
commit f91fe41f1d
25 changed files with 294 additions and 129 deletions

View File

@@ -83,6 +83,21 @@ void RiuPlotMainWindowTools::toggleItemInSelection( const caf::PdmObject* object
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindowTools::selectOrToggleObject( const caf::PdmObject* object, bool toggle )
{
if ( toggle )
{
RiuPlotMainWindowTools::toggleItemInSelection( object );
}
else
{
RiuPlotMainWindowTools::selectAsCurrentItem( object );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -34,5 +34,6 @@ public:
static void setExpanded( const caf::PdmUiItem* uiItem, bool expanded = true );
static void selectAsCurrentItem( const caf::PdmObject* object, bool allowActiveViewChange = true );
static void toggleItemInSelection( const caf::PdmObject* object, bool allowActiveViewChange = true );
static void selectOrToggleObject( const caf::PdmObject* object, bool toggle );
static void refreshToolbars();
};

View File

@@ -557,6 +557,12 @@ bool RiuQwtPlotWidget::eventFilter( QObject* watched, QEvent* event )
{
if ( isZoomerActive() ) return false;
if ( mouseEvent->type() == QMouseEvent::MouseButtonDblClick )
{
if ( m_plotDefinition ) m_plotDefinition->zoomAll();
return true;
}
bool toggleItemInSelection = ( mouseEvent->modifiers() & Qt::ControlModifier ) != 0;
if ( mouseEvent->type() == QMouseEvent::MouseButtonPress && mouseEvent->button() == Qt::LeftButton )
@@ -930,13 +936,14 @@ void RiuQwtPlotWidget::selectClosestPlotItem( const QPoint& pos, bool toggleItem
highlightPlotItems( plotItems );
auto plotItem = std::make_shared<RiuQwtPlotItem>( closestItem );
emit plotItemSelected( plotItem, toggleItemInSelection, distanceFromClick < 10 ? closestCurvePoint : -1 );
scheduleReplot();
}
else
{
emit plotSelected( toggleItemInSelection );
}
// Always do a replot, as the reset operation also requires replot
replot();
}
//--------------------------------------------------------------------------------------------------
@@ -1136,7 +1143,7 @@ void RiuQwtPlotWidget::highlightPlotAxes( QwtAxisId axisIdX, QwtAxisId axisIdY )
if ( axisId != axisIdX && axisId != axisIdY )
{
auto axisWidget = m_plot->axisWidget( axisId );
axisWidget->setStyleSheet( "color: gray" );
axisWidget->setStyleSheet( "color: #D9D9D9" );
}
}
}