added info of the cursor position

This commit is contained in:
nemu
2009-05-28 11:01:08 +00:00
parent 34e8324766
commit 4577590759
2 changed files with 16 additions and 0 deletions

View File

@ -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>

View File

@ -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();