added info of the cursor position
This commit is contained in:
@ -33,6 +33,7 @@
|
||||
using namespace std;
|
||||
|
||||
#include <qtextedit.h>
|
||||
#include <qstatusbar.h>
|
||||
#include <qaction.h>
|
||||
#include <qmenubar.h>
|
||||
#include <qpopupmenu.h>
|
||||
@ -453,6 +454,8 @@ void PTextEdit::doConnections( PSubTextEdit *e )
|
||||
this, SLOT( fontChanged( const QFont & ) ) );
|
||||
|
||||
connect( e, SIGNAL( textChanged() ), this, SLOT( textChanged() ));
|
||||
|
||||
connect( e, SIGNAL( cursorPositionChanged(int, int) ), this, SLOT( currentCursorPosition(int, int) ));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -1743,6 +1746,18 @@ void PTextEdit::textChanged(const bool forced)
|
||||
fTabWidget->setTabLabel(fTabWidget->currentPage(), tabLabel+"*");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::currentCursorPosition(int para, int pos)
|
||||
{
|
||||
QString str;
|
||||
|
||||
str = QString("cursor pos: %1, %2").arg(para+1).arg(pos+1);
|
||||
statusBar()->message(str);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
|
@ -111,6 +111,7 @@ private slots:
|
||||
|
||||
void fontChanged( const QFont &f );
|
||||
void textChanged(const bool forced = false);
|
||||
void currentCursorPosition(int para, int pos);
|
||||
|
||||
void replace();
|
||||
void replaceAndClose();
|
||||
|
Reference in New Issue
Block a user