added info of the cursor position
This commit is contained in:
@ -33,6 +33,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include <qtextedit.h>
|
#include <qtextedit.h>
|
||||||
|
#include <qstatusbar.h>
|
||||||
#include <qaction.h>
|
#include <qaction.h>
|
||||||
#include <qmenubar.h>
|
#include <qmenubar.h>
|
||||||
#include <qpopupmenu.h>
|
#include <qpopupmenu.h>
|
||||||
@ -453,6 +454,8 @@ void PTextEdit::doConnections( PSubTextEdit *e )
|
|||||||
this, SLOT( fontChanged( const QFont & ) ) );
|
this, SLOT( fontChanged( const QFont & ) ) );
|
||||||
|
|
||||||
connect( e, SIGNAL( textChanged() ), this, SLOT( textChanged() ));
|
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+"*");
|
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>
|
* <p>
|
||||||
|
@ -111,6 +111,7 @@ private slots:
|
|||||||
|
|
||||||
void fontChanged( const QFont &f );
|
void fontChanged( const QFont &f );
|
||||||
void textChanged(const bool forced = false);
|
void textChanged(const bool forced = false);
|
||||||
|
void currentCursorPosition(int para, int pos);
|
||||||
|
|
||||||
void replace();
|
void replace();
|
||||||
void replaceAndClose();
|
void replaceAndClose();
|
||||||
|
Reference in New Issue
Block a user