Q published The Blue Pavilions in 1891. He was living in London at the time and overworking. After he had finished the novel he suffered a nervous breakdown and moved to Fowey in Cornwall.
The novel is set in Harwich, The Hague and Dunkirk in the time of Charles II. It has as its background the historical events of the time but one of the book’s main concerns is the theme of the education of young people, something that Q cared about passionately.
Here you can read about the historical events that were happening at the time the novel was set. You can also see an example of how Q included historical detail into his fiction. There is also a chapter-by-chapter summary of the novel.
If you want to read more about The Blue Pavilions, there is also a short study about the novel.
You can also read the novel for yourself on the Internet Archive site, or download the text of the story from the Project Gutenberg site.