But if you are writing this lib your self, why don't you just make a method that accepts (and demands) the parent from the application?
So in your lib, you initialize a member variable, which is a QWidget pointer to NULL, and later check if it is not NULL - this means the application supplied a parent, if it is, through an exception, abort, or let your lib respond in any apropriate manner.
Clean, simple, and cross platform.
Bookmarks