1 Attachment(s)
QtColorComboBox leads to a crash when used as an editor in a QItemDelegate derivative
Hi,
I have implemented a minimal example to showcase an issue I've come across when using QtColorComboBox (http://doc.qt.nokia.com/solutions/4/...rcombobox.html). When I use the "more" entry to get a custom color and use the "named color entry" in the following color dialog or select a color and press ok or cancel in the same color dialog, the application crashes. Valgrind tells me of invalid reads and writes in the qtcolorcombobox class. I would really appreciate it if someone helped me to find the cause of these crashes. I've attached the test application to this post. The QtColorComboBox class is included in the thirdparty subdirectory so there are no dependecies (except Qt of course) in order to test the application. The valgrind log is also included in the root directory and is called valgrind.log.
Thankx in advance
Re: QtColorComboBox leads to a crash when used as an editor in a QItemDelegate deriva
Re: QtColorComboBox leads to a crash when used as an editor in a QItemDelegate deriva
Might be too late, but I saw this post that reminded me of your problem.
Re: QtColorComboBox leads to a crash when used as an editor in a QItemDelegate deriva
Quote:
Originally Posted by
norobro
Might be too late, but I saw this
post that reminded me of your problem.
Interesting. I think it's a bug in the QtColorComboBox class. I created my own colorcombobox that behaves identically to QtColorComboBox but doesn't exhibit the crash.
1 Attachment(s)
Re: QtColorComboBox leads to a crash when used as an editor in a QItemDelegate deriva
After seeing that post I played around with your example a little and ended up adding the following code to the Delegate class to solve the segfault problem:
Code:
Q_UNUSED(obj);
if(event
->type
()==QEvent::FocusOut) return true;
return false;
}
How did you handle retaining the custom colors when the delegate goes out of scope?