QLabel showFullScreen not working correctly
I have an image that I display, and I’m trying to resize to fullscreen dynamically. The problem is that showFullScreen doesn’t work by itself; I have to set a QSize (and this is definitely not the correct way). What am I doing wrong?
- //resize to fullscreen dynamically by device?
- //doesn't work on it's own
- imageLabel->showFullScreen();
11 replies
I have an image that I display, and I’m trying to resize to fullscreen dynamically. The problem is that showFullScreen doesn’t work by itself; I have to set a QSize (and this is definitely not the correct way). What am I doing wrong?
Sorry to be so abrupt: but if it works, why bother? Get the app out the door, and make money!
showFullScreen will not break the layout: What is the size policy of your widget? What are is the maximum size of it?
yes check if you set any fixed size policy
also set the windowtype and windowflags to make it a top level window, then you should be able to show it full screen
also note the platform limitations as mentioned in the docs
Not trying to offend.Just trying to tell him to move on. You cannot always find perfect solution!
the author knows that showing full screen by using size is flawed and is seeking a better solution. we are engineers and lets find a better way to do it. lets not forget quality.
also request you to post an answer only if you know the answer. else some other user who knows the answer, or who can provide good hints will pitch in. we are all here to learn and help each other.
thanks!
chetankjain, ignore tamhanna – he’s just spamming and if you reply you give him a reason to reply again with ‘yes’ or ‘i agree’ or some other meaningless message.
The platform isn’t mentioned which could affect how showFullScreen works. The size of 350×600 seems suspicious for fullscreen. Not a desktop?
Also, is there any main window code? Or is this widget the window?
Remember that changing it to a Qt::Window will move it to the origin (0,0) relative to parent windows/desktop. It’s just using setParent().
Shouldn’t affect fullscreening. But maybe if you get out of fullscreen after.
You could use a maximise hint with a frameless border as an alternative to fullscreen as well.
You must log in to post a reply. Not a member yet? Register here!






