QFileDialog might be using a separate thread for populating QFileSystemModel. QLineEdit shouldn't be using separate threads unless you are using a completer with QFileSystemModel.
QFileDialog might be using a separate thread for populating QFileSystemModel. QLineEdit shouldn't be using separate threads unless you are using a completer with QFileSystemModel.
Thanks,
you are right
Qt Code:
somewhere in the code: model = new QFileSystemModel(q);To copy to clipboard, switch view to plain text mode
But QLineEdit creates 2 Threads in my simple case.
Qt Code:
To copy to clipboard, switch view to plain text mode
Somewhere in the code in its init
Qt Code:
q->setAcceptDrops(true); //here it creates 2 threadsTo copy to clipboard, switch view to plain text mode
![]()
Am I the only one where QLineEdit creates threads?
QLineEdit is not using any threads, at least not by itself. Why did you think it was using threads?
donglebob is right. Instantiating QLineEdit creates threads of its own. On my system (Windows 7, Qt 4.6.2) it creates 4 threads! Actually, the threads are created inside QWidget::setAcceptDrops(), because QLineEdit calls this method inside the constructor. After a bit more debugging I've found out that the threads are created by a WinAPI function CoLockObjectExternal
Edit: I've found a way to prevent this behavior. One must callbefore the widget is shown.Qt Code:
To copy to clipboard, switch view to plain text mode
Last edited by Strix Code; 6th July 2010 at 19:13.
Q7Goodies - The sweetest way to add Windows 7 features to your Qt application
Bookmarks