From 71a7c55176439d43543dd85977da9234b42bdc64 Mon Sep 17 00:00:00 2001 From: ouv Date: Thu, 25 Apr 2019 19:09:32 +0300 Subject: [PATCH] Modifications for DIAGRAM issues: 1) 0004250: External 642: Add a search function to DIAGRAM 2) 0004461: Diagram is not activated after "Split Vertically" operation --- src/Qtx/QtxSearchTool.cxx | 18 ++++++++++++++++++ src/Qtx/QtxSearchTool.h | 2 ++ src/Qtx/QtxWorkstack.cxx | 7 ++++++- src/Qtx/QtxWorkstack.h | 2 +- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Qtx/QtxSearchTool.cxx b/src/Qtx/QtxSearchTool.cxx index 88e2bae13..5656a695a 100644 --- a/src/Qtx/QtxSearchTool.cxx +++ b/src/Qtx/QtxSearchTool.cxx @@ -470,6 +470,24 @@ void QtxSearchTool::setShortcuts( const QList& accels ) initShortcuts( accels ); } +/*! + \brief Set context of shortcuts. + \param context context of shortcuts + \sa shortcuts() +*/ +void QtxSearchTool::setShortcutContext( const Qt::ShortcutContext context ) +{ + ShortcutList::Iterator it; + for ( it = myShortcuts.begin(); it != myShortcuts.end(); ++it ) + { + if ( !(*it).isNull() ) + { + QShortcut* sc = (*it); + sc->setContext( context ); + } + } +} + /*! \brief Add custom widget. \param w custom widget to be added diff --git a/src/Qtx/QtxSearchTool.h b/src/Qtx/QtxSearchTool.h index f91d00ff0..674eaca67 100644 --- a/src/Qtx/QtxSearchTool.h +++ b/src/Qtx/QtxSearchTool.h @@ -99,6 +99,8 @@ public: void setShortcuts( const QKeySequence& ); void setShortcuts( const QList& ); + void setShortcutContext( const Qt::ShortcutContext ); + int addCustomWidget( QWidget*, int = -1 ); QWidget* customWidget( int ) const; int customWidgetId( QWidget* ) const; diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index 02314d67f..ef00b4886 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -1605,9 +1605,14 @@ QWidget* QtxWorkstack::activeWindow() const /*! \brief Set active widget \param wid widget to activate + \param activateArea flag used to activate the widget's area if necessary */ -void QtxWorkstack::setActiveWindow( QWidget* wid ) +void QtxWorkstack::setActiveWindow( QWidget* wid, const bool activateArea ) { + if( activateArea ) + if( QtxWorkstackArea* area = wgArea( wid ) ) + setActiveArea( area ); + if( activeArea() ) activeArea()->setActiveWidget( wid ); } diff --git a/src/Qtx/QtxWorkstack.h b/src/Qtx/QtxWorkstack.h index b18bb4dcb..a703dd467 100644 --- a/src/Qtx/QtxWorkstack.h +++ b/src/Qtx/QtxWorkstack.h @@ -81,7 +81,7 @@ public: QWidgetList splitWindowList() const; QWidget* activeWindow() const; - void setActiveWindow( QWidget* ); + void setActiveWindow( QWidget*, const bool activateArea = false ); int accel( const int ) const; void setAccel( const int, const int ); -- 2.39.2