static void clearHistory(QWebPage* page) { // QWebHistory::clear() leaves current page, so remove it as well by setting // max item count to 0, and then setting it back to it's original value. QWebHistory* history = page->history(); int itemCount = history->maximumItemCount(); history->clear(); history->setMaximumItemCount(0); history->setMaximumItemCount(itemCount); }
static PyObject *meth_QWebHistory_setMaximumItemCount(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { int a0; QWebHistory *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "Bi", &sipSelf, sipType_QWebHistory, &sipCpp, &a0)) { sipCpp->setMaximumItemCount(a0); Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QWebHistory, sipName_setMaximumItemCount, doc_QWebHistory_setMaximumItemCount); return NULL; }