From 7fe1690e3da787f162482f8e7744b43fdf3f00d8 Mon Sep 17 00:00:00 2001 From: san Date: Tue, 2 Nov 2010 07:31:37 +0000 Subject: [PATCH] New signal pathSelected() emited when user select path via browse file dialog --- src/Qtx/QtxPathEdit.cxx | 8 ++++++-- src/Qtx/QtxPathEdit.h | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Qtx/QtxPathEdit.cxx b/src/Qtx/QtxPathEdit.cxx index 8c3c7b18d..cdd9a24e8 100644 --- a/src/Qtx/QtxPathEdit.cxx +++ b/src/Qtx/QtxPathEdit.cxx @@ -221,8 +221,11 @@ void QtxPathEdit::onBrowse( bool /*on*/ ) break; } - if ( !path.isEmpty() ) - myPath->setText( QDir::convertSeparators( path ) ); + if ( !path.isEmpty() ) { + QString txt = QDir::convertSeparators( path ); + emit pathSelected( txt ); + myPath->setText( txt ); + } myPath->setFocus(); } @@ -254,6 +257,7 @@ void QtxPathEdit::initialize() base->addWidget( browse ); connect( browse, SIGNAL( clicked( bool ) ), this, SLOT( onBrowse( bool ) ) ); + connect( myPath, SIGNAL( textChanged( const QString& ) ), this, SIGNAL( pathChanged( const QString& ) ) ); setFocusProxy( myPath ); diff --git a/src/Qtx/QtxPathEdit.h b/src/Qtx/QtxPathEdit.h index 018e2349d..941be6c2e 100644 --- a/src/Qtx/QtxPathEdit.h +++ b/src/Qtx/QtxPathEdit.h @@ -52,6 +52,10 @@ public: const QValidator* validator() const; void setValidator( QValidator* ); +signals: + void pathChanged( const QString& ); + void pathSelected( const QString& ); + private slots: void onBrowse( bool = false ); -- 2.39.2