Thread: EbookViewer.pos
View Single Post
Old 05-14-2016, 07:13 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,444
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
pos is juts a simple frac between 0 and 1. The difficulty in getting progress in the chapter is that you have to first know the chapter start and end limits (in the general case a chapter does not necessarily have to be in a self contained html file). You can get the limits the same way the ToC code in the viewer knows which entry to highlight.

However, before you go any further, you should know that the viewer is in maintenance mode. The library it is based on (Qt WebKit) has been discontinued so it is going to be be replaced by a new codebase -- the new codebase is currently being developed for the in-browser viewer for calibre 3.0. When that is completed, it will be used to switch the desktop viewer over to use Qt WebEngine instead of Qt WebKit.
kovidgoyal is online now   Reply With Quote