take a look implementation of QtKeySequenceEdit in QTDIR\tools\shared\qtpropertybrowser\qttreepropert ybrowser.cpp.
take a look implementation of QtKeySequenceEdit in QTDIR\tools\shared\qtpropertybrowser\qttreepropert ybrowser.cpp.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
I accidentaly use this code
When editting lineDoNo it doesnt work but When I edit lineMa, lineDeNo works fine,Qt Code:
} lineMa->setText(ks.toString()); }To copy to clipboard, switch view to plain text mode
I try
but it doesnt work...Qt Code:
}To copy to clipboard, switch view to plain text mode
do you install event filters for both lineedits?
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
yes, I do install for both lines
ok, can you attach compilable example which contains this bug?
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
do you mean the code for this area?
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