minimal compilable example which reproduce your problem.
minimal compilable example which reproduce your problem.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Qt Code:
lineDeNo->installEventFilter(this); lineMa->installEventFilter(this);To copy to clipboard, switch view to plain text mode
Qt Code:
{ // lineMa->setText(ks.toString()); } }To copy to clipboard, switch view to plain text mode
This is not compilableA compilable example is something that includes a main() and the piece of code you want tested so that if one writes qmake && make it will compile.
And please don't start multiple threads on the same subject. Moving to newbie (again).
this how should look like "minimal compilable example"
works fine, but symbol duplicated.Qt Code:
#include <QtGui> { Q_OBJECT public: { m_lineEditNativeText->installEventFilter(this); m_lineEditPortableText->installEventFilter(this); vbl->addWidget(m_lineEditNativeText); vbl->addWidget(m_lineEditPortableText); } protected: { if (o == m_lineEditNativeText) else if (o == m_lineEditPortableText) m_lineEditPortableText->setText(ks.toString()); } } private: QLineEdit *m_lineEditNativeText; QLineEdit *m_lineEditPortableText; }; int main(int argc, char **argv) { TestWidget tw; tw.show(); return app.exec(); } #include "main.moc"To copy to clipboard, switch view to plain text mode
Last edited by spirit; 7th May 2009 at 09:32. Reason: updated contents
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
aekilic (7th May 2009)
intresting thing, if modify my code in this way
then a string in m_lineEditPortableText contains text without duplicating letter.Qt Code:
if (o == m_lineEditNativeText) { m_lineEditPortableText->setText(ks.toString()); }// else if (o == m_lineEditPortableText) // m_lineEditPortableText->setText(ks.toString());To copy to clipboard, switch view to plain text mode
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
aekilic (7th May 2009)
crap, it's my mistake, eventFilter should look like
Qt Code:
{ if (o == m_lineEditNativeText) { return true; } else if (o == m_lineEditPortableText) { m_lineEditPortableText->setText(ks.toString()); return true; } } }To copy to clipboard, switch view to plain text mode![]()
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
aekilic (7th May 2009)
Let me try
yes works perfect thank you very much spirit you are my life saver!
Bookmarks