EDIT: This application will run on Windows, Mac, and various Linux distributions. I know Linux has problems with this, but what about Windows? Mac?
Is there a way to get the frame width for a regular window, PRIOR to display any windows? After showing the window, I know that I can subtract size() from frameSize() , but this does not work until the window appears.
I looked QApplication::style()->pixelMetric() and I can get the title bar height using
QApplication::style()->pixelMetric(QStyle::PM_TitleBarHeight)
but I don't see any options to get the width of the rest of the frame around the window.
The only solution I have found so far is this:
- set the opacity of the window to 0 (so that the user does not see it),
- show window
- then subtract
size() from frameSize()
Is there a better way?
source share