Qt: transparent QRubberBand? - user-interface

I'm trying to draw a QRubberBand on a QGLWidget. For some reason the area of the rubber band is drawn as opaque and I don't see what's behind it. This kinda beats the purpose of the rubber band as a way to select stuff inside it.
I've seen in docs for QStyleOptionRubberBand that there's an 'opaque' member but I have no idea how to access this in the default style or how to change it.
Anybody ever done this?

Are you in Vista/Win7 with Areo on? If so, does it work when you turn it off?
EDIT:
How about Message #6?
"In the meantime I looked it up in the QT source code, and I noticed that the following will solve my problem: myQRubberBand->setWindowFlags(Qt::ToolTip);"

It would be great having any source code ?
But here are how I would attempt to fix the problem :
Subclass QRubberBand
Redefine PaintEvent method
call iniStyleOption to activate style options of your choice
Hope it helps !

Related

Xcode SwiftUI modify extension variable

I have an extension of Color that stores a colour variable. I am currently using this to set the main colour for the whole app, which currently works.
extension Color{ static var colour: Color = Color.red }
If I set it to red everything turns red. But at the moment I have to hard code what colour it will be. I want to be able to modify this colour during runtime.
I have tried to modify the extension at runtime but I can’t seem to get it working and I’m not sure if it allows you to do this. I’m not sure the best way to approach this.
If anyone has anyway of changing the variable in an extension that would be ideal but if there’s another way, any help would be greatly appreciated. If you have any questions or I haven’t explained something clearly ask away.
Thanks so much

create a simple (and visible!) UI slider in Unity 5

![enter image description here][1]please I need some help, this should apparently be something very simple and basic to do, but maybe I'm missing something.
I'm quite newbie to Unity3d, I had no much problem with creating a somewhat flashy 2.D scene (I mean 2D with different layers in Z level), scripts, etc. But I'm having trouble to create a "UI Slider" object: when I create it, it just shows nothing on screen. How can I make it visible? I just need to create a very simple, plain slider whose value can be controlled at runtime by means of a script.
thanks.
Well.. since you give nothing to go on, I suggest that you take a look at a tutorial for the UI:
https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/using-the-ui-tools
If you have troubles after this tutorial, come back with an example of your problem to make people more willing to sacrifice their time in helping you.
Hope this is somewhat useful
Take a look at the Unity3D docs here.
http://docs.unity3d.com/Manual/script-Slider.html
It should have what you are looking for.

Rotating a UIButton?

I am trying to rotate a UIButton so it looks more like a diamond instead of a square. I have searched a lot on the site and could not find anything that could help me. I am having a lot of trouble with this and need some help. I think it will increase the appeal of my app when it is running. This is a problem I have had for a while and have been struggling with so anything can help me. I don't know if this is a built in feature in Xcode or if I need to do this programmatically.
Any suggestions would be greatly appreciated.
Thanks in advance.
You could simply apply an affine transform to the button. Something like this:
import Darwin
...
myButton.transform = CGAffineTransformMakeRotation(M_PI/2)
However, that will rotate the entire button, including the title. If that's not what you want then it gets more complicated.

Documentation for three.js controls?

three.js comes with many useful controls, which cause camera movement in response to keyboard and mouse input.
They are all at https://github.com/mrdoob/three.js/blob/master/examples/js/controls and accessed in the code as e.g.THREE.OrbitControls .
However, I can't find any documentation or comments that says what situation to use what control for or what they are intended to do.
Can anyone point me to this information, or do I have to analyze the code to figure out if, for example, I prefer FlyControls to FirstPersonControls?
The documentation for the controls does exist, but it was deleted from the repository here. Seems like a bizarre thing to do, but there is an explanation of sorts here. I guess the docs were very incomplete anyway and it was easier to delete them than to finish them. :-p
The source code for most of the controls contains pretty decent comments. I know this isnt as good as proper documentation but it really helps to get a handle on how to set up the controls
The Controls are named by their purpose or the idea they implement. OrbitControls allow you to orbit around some kind of object. Same for Trackball-Controls although the trackball-scheme implies that the camera will rotate around without the up-Axis staying as it was like in orbit-controls. Fly and FPS-Controls are self-explanatory.
Just try the examples and you will see what the difference is. No need to analyse code. Just depends on what you want to achieve.

NSShadow and paper-curl effect in Desktop

i was playing with some source code from this blog:
http://nachbaur.com/blog/fun-shadow-effects-using-custom-calayer-shadowpaths
because i wanted to replicate its paper-curl effect with the shadow.
But it seems the property shadowPath of CALayer is not available in OSX, only in iPhone.
Could anyone suggest another method to achieve that kind of effect?
bets regards
Why not to use CIPageCurlTransition?
http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CoreImageFilterReference/Reference/reference.html

Resources