Solved Multiple AutoCompleters for the same LineEdit box
-
It's the list of functions called shown by the debugger when the application crashes.
-
Hi
What you mean by
"why i can't assign a different Qcompleter from elsewhere in the code" ?
In what why does it not work ? -
I think by watching this video by VoidRealms I will be able to gather this info.
https://www.youtube.com/watch?v=B7UsWtyhXh4 -
I mean that in the animalsearch ui(new Ui::AnimalSearch) I create the Qcompleters from data i collect from sql into a model that i parse to QstringLists, then in a cmbFilter slot I assign the Qcompleter to the lineBy box.
-
@Core2
Ok. that should just work.
I tried the Qt completer sample and there seems to be no issues switching completer. -
Interesting. I may set up a test project where i set up a basic program to do this one thing with a cmbFilter, and a LineEdit. Until then I think I go the debugger working and am getting good info. I'm about to respond to SGaist.
-
@Core2
Ok. good plan. The call stack will show what happened up till the crash.
-
In the issues window: "c:\blahblahblah\qt\qtbase\src\corelib\tools\qscopedpointer.h:140: error: Debugger encountered an exception: Exception at 0x7747379a, code: 0xc0000005: read access violation at: 0x0, flags=0x0 (first chance)
In the Debugger Window: There is 76 Levels, and there is a yellow arrow pointing to the level 11, AnimalSearch::on_cmbFilter_currentIndexChanged.
The file column of that row contains this animalsearch.cpp
The line row contains 300, which is the line just after the line ui->lineBy->setCompleter(RabbitCompleter);Looking at the top right window after i click on the level 11, I can see what variables are in memory and what the value and types are (Too freaking cool!)
Is the information i listed above the backtrace?
-
Hi
I would check the values of all UI widgets (if non null)
and i would also
change so .h says
QCompleter *TurtleCompleter=0;
QCompleter *RabbitCompleter=0;
QCompleter *DogCompleter=0;
QCompleter *CatCompleter=0;so im sure they are allocated when i reach crash point ( as in not null)
The error code: 0xc0000005: + 0x0, suggests a null pointer.
-
Thank you both for taking the time to help me through this. Setting the pointers to 0 first fixed the issue!
I have now added code that looks at the index value of cmbFilter and changes the Qcompleter being used on the lineBy box. Good stuff!
Have a good day!