[Qt-interest] Qt Assistant previous & next navigation

Mitchell Model MLMDev at comcast.net
Mon Dec 28 17:40:15 CET 2009


A week ago I asked about a shortcut to go to the next and previous  
page in Qt Assistant. I was ambiguous in my description of the "next"  
and "prev" functionality I was looking for. I meant the logically  
"Next" and "Prev" pages as defined by links at the top and bottom of  
the page, not the "next" and "prev" pages according to the order in  
which I browsed them, as a browser would interpret it. The latter is,  
of course, already in Qt Assistant.

It turns out that Qt Assistant is just a Qt application that wraps a  
bit of extra interface around Qt's HTML documentation. Look for doc/ 
html in the Qt installation, and start with something like index.html  
or overviews.html in that directory.

Here is JavaScript for clicking the next and prev page links. You can  
install as bookmarklets and give those a shortcut key (depending on  
your browser) or use some other keystroke binding facility to assign  
them. I've checked them on Firefox, Safari, and Camino on OS X.

	Previous:
	 
javascript:nodes 
=document.body.childNodes[2].childNodes;if(nodes.length &&  
"\n[Previous: " == nodes[0].textContent) 
{window.location=nodes[1].href}else{alert("No Previous Topic")}

	Next
	javascript:(function() 
{nodes=document.body.childNodes[2].childNodes;for(n=0;n<nodes.length;n 
+=2){if("\n[Next: "==nodes[n].textContent.slice(-8)) 
{window.location=nodes[n+1].href;return}}alert("No Next Topic")}())



More information about the Qt-interest-old mailing list