position label change to signal slot

This commit is contained in:
yodalee 2014-12-10 16:44:17 +08:00
parent a15abc4e49
commit 2fd15cef1b
4 changed files with 16 additions and 3 deletions

View File

@ -112,6 +112,8 @@ Schematic::Schematic(QucsApp *App_, const QString& Name_)
connect(this, SIGNAL(verticalSliderReleased()),
viewport(), SLOT(update()));
if (App_) {
connect(this, SIGNAL(signalCursorPosChanged(int, int)),
App_, SLOT(printCursorPosition(int, int)));
connect(this, SIGNAL(horizontalSliderPressed()),
App_, SLOT(slotHideEdit()));
connect(this, SIGNAL(verticalSliderPressed()),
@ -165,7 +167,8 @@ bool Schematic::createSubcircuitSymbol()
// ---------------------------------------------------
void Schematic::becomeCurrent(bool update)
{
App->printCursorPosition(0, 0);
QString *ps;
emit signalCursorPosChanged(0, 0);
// update appropriate menu entry
if (symbolMode) {
@ -515,7 +518,7 @@ void Schematic::PostPaintEvent (PE pe, int x1, int y1, int x2, int y2, int a, in
// ---------------------------------------------------
void Schematic::contentsMouseMoveEvent(QMouseEvent *Event)
{
App->printCursorPosition(Event->pos().x(), Event->pos().y());
emit signalCursorPosChanged(Event->pos().x(), Event->pos().y());
if(App->MouseMoveAction)
(App->view->*(App->MouseMoveAction))(this, Event);
}

View File

@ -148,6 +148,9 @@ public:
QFileInfo getFileInfo (void) { return FileInfo; }
signals:
void signalCursorPosChanged(int, int);
protected:
bool sizeOfFrame(int&, int&);
void paintFrame(ViewPainter*);

View File

@ -65,6 +65,10 @@ TextDoc::TextDoc(QucsApp *App_, const QString& Name_) : QPlainTextEdit(), QucsDo
connect(this, SIGNAL(textChanged()), SLOT(slotSetChanged()));
connect(this, SIGNAL(cursorPositionChanged()),
SLOT(slotCursorPosChanged()));
if (App_) {
connect(this, SIGNAL(signalCursorPosChanged(int, int)),
App_, SLOT(printCursorPosition(int, int)));
}
syntaxHighlight = new SyntaxHighlighter(this);
syntaxHighlight->setLanguage(language);
@ -322,7 +326,7 @@ void TextDoc::slotCursorPosChanged()
QTextCursor pos = textCursor();
int x = pos.blockNumber();
int y = pos.columnNumber();
App->printCursorPosition(x+1, y+1);
emit signalCursorPosChanged(x+1, y+1);
tmpPosX = x;
tmpPosY = y;
}

View File

@ -87,6 +87,9 @@ public:
QMenu* createStandardContextMenu();
signals:
void signalCursorPosChanged(int, int);
public slots:
void search(const QString &str, bool CaseSensitive, bool wordOnly, bool backward);
void replace(const QString &str, const QString &str2, bool needConfirmed,