summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-11-10 14:10:27 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-11-10 14:10:27 (GMT)
commit9792ee15c60a4b8a849d5a098047482d192185ec (patch)
tree7c3d4d3f9327fe75d14504ef09b8c5a68a8f8fd2 /doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp
parent9c1639b401a87b9a93d07f1b0ad9a18b19bf7cdc (diff)
downloadQt-9792ee15c60a4b8a849d5a098047482d192185ec.zip
Qt-9792ee15c60a4b8a849d5a098047482d192185ec.tar.gz
Qt-9792ee15c60a4b8a849d5a098047482d192185ec.tar.bz2
Replace most processEvents() with sendPostedEvents().
After a change Brad did to the event dispatcher we are no longer guaranteed that processEvents will process *all* events in the event queue. (most of the time _it_will_ process all events) I only replaced processEvents for the tests that fail.
Diffstat (limited to 'doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp')
0 files changed, 0 insertions, 0 deletions
t">(); stack->push(command1); MyCommand *command2 = new MyCommand(); stack->push(command2); stack->undo(); MyCommand *command3 = new MyCommand(); stack->push(command3); // command2 gets deleted //! [1] //! [2] QUndoCommand *insertRed = new QUndoCommand(); // an empty command insertRed->setText("insert red text"); new InsertText(document, idx, text, insertRed); // becomes child of insertRed new SetColor(document, idx, text.length(), Qt::red, insertRed); stack.push(insertRed); //! [2] //! [3] bool AppendText::mergeWith(const QUndoCommand *other) { if (other->id() != id()) // make sure other is also an AppendText command return false; m_text += static_cast<const AppendText*>(other)->m_text; return true; } //! [3] //! [4] stack.beginMacro("insert red text"); stack.push(new InsertText(document, idx, text)); stack.push(new SetColor(document, idx, text.length(), Qt::red)); stack.endMacro(); // indexChanged() is emitted //! [4] //! [5] QUndoCommand *insertRed = new QUndoCommand(); // an empty command insertRed->setText("insert red text"); new InsertText(document, idx, text, insertRed); // becomes child of insertRed new SetColor(document, idx, text.length(), Qt::red, insertRed); stack.push(insertRed); //! [5]