The title is best written after the body of the question because it is there to summarize what is in the body. As a result it should not introduce any new terms or information not covered in the body. By making this as succinct and accurately descriptive of the body as possible you are likely to attract more potential answerers to open your question.
I think you should avoid starting titles like "How to do X? and "How do I do X?". I think it is better to use a more succinct statement title like "Doing X" instead.
For your question here, which is currently titled as:
Creating a "good title" for a new question
I would instead use a title of:
Creating good title for new question
I have dropped the "a", the "the" and the double quotes because I think they all make the title longer than it needs to be to convey the same information.
I also think that the body of your "pkg-config and Qt" question needs more focus so that it not only tells your potential answerers what you want to do (i.e. "run pkg-config for Qt5"), but also what you have tried and where you are stuck.