I'm making a flex 3.5a/air2 application and I've made a popup window but I can't seem to get its bottom corners rounded. Setting cornerRadius seems to only affect the top corners.
There doesn't seem to be a roundedBottomCorners property like there is for panels, and adding a controlbar with a cornerRadius also has no effect.
I'm sure this is a very simple problem but would really appreciate any help as I can't find the answer on google or after searching on here!
If you can give up window header (and paint it yourself), try to make transparent window (with transparent background) and construct it from controls you need. I'm sure you can get window of any shape this way.
Ended up making the window transparent and setting showFlexChrome to false. Then using a container I was able to get rounded corners.
It didn't help my other problem which was trying to get a glow effect around the window and still being able to resize it.. for that I had to override the mouseDownHandler from the window class so I could modify the drag locations to the container canvas. What a pain!
Related
I'm trying to follow the example at the below link to have a picture (in a qlabel) shown in a scrollable area.
https://doc.qt.io/qt-5/qtwidgets-widgets-imageviewer-example.html
I'm using Qt Designer to make the ui instead of hardcoding everything. So I have a QLabel, in a QWidget (with a grid layout assigned to it), in a QScrollArea.
From the tutorial, they state the following for the sizepolicy of the QLabel:
We set imageLabel's [QLabel] size policy to ignored, making the users able to scale the image to whatever size they want when the Fit to Window option is turned on. Otherwise, the default size policy (preferred) will make scroll bars appear when the scroll area becomes smaller than the label's minimum size hint.
Setting it to ignored fits to the window, as expected and as stated. Setting it to preferred provides scroll bars when the image is larger than the scroll area, also as expected and as stated. My issue is that when the sizepolicy is set to preferred, the resize function of the QLabel doesn't work. It always stays at the default size of the loaded image. The only way that I'm able to get the resize function to work is when I don't assign a layout/break the layout to the widget in the QScrollArea, but then no scrollbars will appear when the image is larger than the QScrollArea.
Does anyone have any ideas of how to make the resize function and scrollbars work at the same time?
Thanks in advance for any help. I'm trying to learn qt5 still and this seems like it'd be a simple thing to do, but it's slowly driving me crazy.
When I resize a JavaFX window, I get the red highlighted spaces
at the bottom and right. I’ve tried a lot in the SceneBuilder to auto-maximize the “Bottom Left Control” by specifying a larger height & width alongside a “Pref Height” and “Pref Width” but nothing worked.
Of course I could register a resize listener that resizes the controls at runtime imperatively but that’s not really a nice solution. Is there a declarative way where this magic is done behind the scenes and where I have to merely set some flag to accomplish this?
I have three background images for a button - left.png, center.png and right.png. The left and right ones have rounded edges and the center one is a single line which need to extend based on the size of the button. How do I create such a button? I have considered the option of constructing the image on the fly and apply it to the button in the resize event, but am looking to see if this is possible through stylesheets. Is this possible?
You can't do it with background-image alone. But it may be done with the help of border-image: http://qt-project.org/doc/qt-4.8/stylesheet-reference.html#border-image
Use background-repeat: repeat-x to fill the button and border-image to round out the edges.
You can do it with QPainter and constructing the image, but honestly for the complexity level and for a button class you might be better off learning how to do it by constructing a paintEvent in full using the standard primitives. It'll give you better fine grain control, just involves a bit of leg work.
I'd like to make a background of a scrollbar of QListView transparent. It should be painted over the content. Something like this. Is it possible?
Sure. Subclass it, override the paint event, and read this.
GUI style on screenshot is QML i think
I ended up with this hack. I just created a new vertical scroll bar, placed it onto viewport and connected it with the original scroll bar. Then I just hidden the original scrollbar :)
You can see the result: http://i.stack.imgur.com/wrQOQ.png
I'm using PopupManager to display (not modal) popups in Flex.
How can I make the background of my TitleWindow popup completely transparent?
Now it is semi-transparent.. see picture with semi-transparent background (i.e. I just want the label inside visible):
http://dl.dropbox.com/u/72686/semiTransparent.png
Maybe, instead of making it transparent I could try to reduce the padding, in order to make only the children visible ?
thanks
If you want to make it transparent, add
borderAlpha="0.0"
If you also want to remove the side and bottom borders completely, add
borderThicknessLeft="0" borderThicknessRight="0"
You can't remove the header, even thought there is borderThicknessTop option.
Also, the borderThickness="0" option doesn't work as far as I know.
Set the backgroundAlpha style of the TitleWindow to 0.
Edit, oops, my mistake, since it's a subclass of Panel, you'll also need to set the borderAlpha style to 0 as well. If you're using the default flex skins, the white arrow is the "background" and the blue area is the "border".