From 72ffc98be62d6d43f177f2ccc5af3f80af143db4 Mon Sep 17 00:00:00 2001 From: gnudles Date: Sun, 5 Feb 2017 20:05:31 +0200 Subject: [PATCH] Small fixes: (#3221) In PianoView.cpp fixed the focus policy so that if one would like to use a QPlainTextEdit in his plugin, he'd be able to do so. In TrackContainerView.cpp and AutomationEditor.cpp there's a problem that if you use a Right To Left locale, all the GUI turn RTL, but in those specific editors, things get very messy, because they were made up with the assumption of LTR. --- src/gui/PianoView.cpp | 6 ++++-- src/gui/TrackContainerView.cpp | 3 ++- src/gui/editors/AutomationEditor.cpp | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index e33c417c5..af15eec9f 100644 --- a/src/gui/PianoView.cpp +++ b/src/gui/PianoView.cpp @@ -668,8 +668,10 @@ void PianoView::focusOutEvent( QFocusEvent * ) // window we live in? if( parentWidget()->parentWidget()->focusWidget() != this && parentWidget()->parentWidget()->focusWidget() != NULL && - !parentWidget()->parentWidget()-> - focusWidget()->inherits( "QLineEdit" ) ) + !(parentWidget()->parentWidget()-> + focusWidget()->inherits( "QLineEdit" ) || + parentWidget()->parentWidget()-> + focusWidget()->inherits( "QPlainTextEdit" ) )) { // then reclaim keyboard focus! setFocus(); diff --git a/src/gui/TrackContainerView.cpp b/src/gui/TrackContainerView.cpp index 61d9e9d9e..f47e7bb09 100644 --- a/src/gui/TrackContainerView.cpp +++ b/src/gui/TrackContainerView.cpp @@ -66,7 +66,8 @@ TrackContainerView::TrackContainerView( TrackContainer * _tc ) : m_origin() { m_tc->setHook( this ); - + //keeps the direction of the widget, undepended on the locale + setLayoutDirection( Qt::LeftToRight ); QVBoxLayout * layout = new QVBoxLayout( this ); layout->setMargin( 0 ); layout->setSpacing( 0 ); diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 87ecb927d..48581dbfd 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -118,6 +118,9 @@ AutomationEditor::AutomationEditor() : setAttribute( Qt::WA_OpaquePaintEvent, true ); + //keeps the direction of the widget, undepended on the locale + setLayoutDirection( Qt::LeftToRight ); + m_tensionModel = new FloatModel(1.0, 0.0, 1.0, 0.01); connect( m_tensionModel, SIGNAL( dataChanged() ), this, SLOT( setTension() ) );