wxCheckListBox::Check() should not emit any event under wxQt
In fact, this is the documented behaviour and also what the other ports are currently doing.
This commit is contained in:
parent
23db0483af
commit
1d12873751
1 changed files with 6 additions and 1 deletions
|
|
@ -80,8 +80,13 @@ bool wxCheckListBox::IsChecked(unsigned int n) const
|
|||
|
||||
void wxCheckListBox::Check(unsigned int n, bool check )
|
||||
{
|
||||
// Prevent the emission of wxEVT_CHECKLISTBOX event by temporarily block all
|
||||
// signals on m_qtListWidget object. QSignalBlocker can be used instead when
|
||||
// Qt 5.3 becomes the minimum supprted version.
|
||||
const bool wasBlocked = m_qtListWidget->blockSignals(true);
|
||||
QListWidgetItem* item = m_qtListWidget->item(n);
|
||||
wxCHECK_RET(item != nullptr, wxT("wrong listbox index") );
|
||||
return item->setCheckState(check ? Qt::Checked : Qt::Unchecked);
|
||||
item->setCheckState(check ? Qt::Checked : Qt::Unchecked);
|
||||
m_qtListWidget->blockSignals(wasBlocked);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue