can you set a predetermined billing app qt? - qml

can you set a vertical orientation in a qml app?
if so?
I have searched on various sites to try and solve this problem. I found it in C ++ code but I would need the piece of code in qml language
I'm using the application project - qt quick application - empty
I'm using a version of qt 5.10.1
thank you

You're looking for Screen.orientationUpdateMask.
Once the mask is set, Screen.orientation will contain the current orientation of the screen.You can read more about the Screem QML type here. Of course the orientation in this case is set by the accelerometer.
If you want to be able to go back and forth between portrait and landscape without the use of the accelerometer and while having the logic in qml you will need to use the Transform, Scale and Rotation QML types. I wouldn't recommend this approach.
One alternative to using Transform would be to use two different views all together, which might not be a good idea for maintainability especially if you want to use the 4 orientations.
If you want to force the orientation no matter what you can do it in the manifest file as you would normally without Qt.

Related

How do you bind windows together in a Cocoa Application so they resize together?

I am attempting my first Cocoa Application after developing for iOS for the past few years. I have been "googling" around for awhile now but I guess I am not using the correct terminology to find what I am looking for.
In many applications OSX applications I see this little dot (or sometimes no dot at all like in XCode) which allows you to grab "an invisble" line? Which will resize two or three windows at a time while they are all bound together. How is this done? I'd like to implement it in my current app I am building. I have attached an image to clarify what I am talking about.
Thanks in advance
These are not windows. These are subviews of an NSSplitView
It's an NSSplitView. The line is the divider and can have 3 different styles:
NSSplitViewDividerStyleThick = 1,
NSSplitViewDividerStyleThin = 2,
NSSplitViewDividerStylePaneSplitter = 3,
(the style in the images of your question are the Pane Splitter style).
The content views can be easily added using Interface Builder, or programmatically using the [NSView addSubview:] method (NSSplitView derives from NSView).
You will want to control the splitter behaviour via its delegate (NSSplitViewDelegate).
Also note that the image in your question appears to show a split view within another split view, which is a fairly common way of laying out views.

Color Picker for Windows store App

I want to add a color picker control to a windows store App (using VB), I came to know that there is no standard control for that. So any ideas about what could be a good purchased or open source option?
So I started building one into WinRT XAML Toolkit here but never got round to finishing it. Mainly because I figured there would need to be very different designs for different platforms. The control isn't finished, but a lot of the components that are there you could use to build a color picker that fits your design. There's a ColorExtensions class that might help you convert between HSL/HSV/RGB models, there's a FromString() method in it that can parse a color string in the formats available in XAML (e.g. "Transparent" or #FFAA0080 or #FB0) and there's a WriteableBitmapColorPickerExtensions class that you can use to render a hue ring, 2D color selector bitmap or a 1D color bar. I'll probably create some usable controls one day to use all of these primitives, but for now - you have that power! :)
I've created a simple color picker for Universal Apps, you can read about it from this blog post...

Objective-C, Methods for animating gui

I've created many types of interfaces using the Cocoa API — some of them using documented basic animation techniques and others simply by experimenting (such as placing an animated .gif inside an NSImage class) — which had somewhat catastrophic consequences. The question I have is what is the correct or the most effective way to create an animated and dynamic GUI so that it runs optimally and properly?
The closest example I can think of that would use a similar type of animation would be something one might see done in flash on any number of interactive websites or interfaces. I'm sure flash can be used in a Cocoa app, although if there is a way to achieve a similar result without re-inventing the wheel, or having to use 3rd party SDKs, I would love to get some input. Keep in mind I'm not just thinking of animation for games, iOS, etc. — I'm most interested in an animated GUI for Mac OS X, and making it 'flow' as one might interact in it.
If u wish to add many graphics animations, then go for OpenGLES based xcode project for iOS. That helps u to reduce performance problem. You can render each of the frames in gif as 2D texture.
I would recommend that you take a look at Core Animation. It is Apples framework for hardware accelerated animations for both OS X and iOS. It's built for making animated GUIs.
You can animate the property changes for things like position, opacity, color, transforms etc and also animate gradients with CAGradientLayer and animate non-rectagunal shapes using CAShapeLayer and a lot of other things.
A good resource to get you started is the Core Animation Programming Guide.

How to Handle iPad Rotation?

I have the core of an iPad app made up, its relatively simple. However I want to add support to portrait mode (currently works in landscape). Trouble is, its quite a customised, unique interface, made of different uiimages, labels, etc
So how when the user rotates the iPad, can I handle the movement of all these objects? Whats the best way to do it?
Thanks.
If you have designed the interface in interface builder, you can build up the relationships between GUI elements through the interface builder, and at a first shot, see what it does with the rotation. This MAY work for you, I know there are interfaces I have designed where this is NOT an option, and others where it works just fine.
Else, You may have to write all of the positioning code yourself. Probably the Best way to do this from my experiance is to use pre-processor directives to define your positions for all of your elements in each of the 2 orientations. This way you write the routines for manipulation and then your small tweaks that you may need to make after you let it run the first time can simply be numeric tweaks in your pre-processor directives file.
http://bynomial.com/blog/?p=85
http://the.ichibod.com/kiji/how-to-handle-device-rotation-for-uiviews-in-ios/

Android: render multiple views in a ScrollView

Have a code that renders custom Views and placed on a ScrollView (n by n) with dynamic width per view.
I've been having sluggish performance when running it in Tablet 10.1 but seems ok in Tablet 7.0.
Would there be any improvements if I replaced Views with SurfaceView?
Or would a single SurfaceView with mapped cell work instead? I've found this sample project but using this as a guide for the current code seems.. difficult, what with different widths on custom views and the resolution on other devices.
Any other suggestions?
It depends on the hardware but if you are running on the emulator, it's not accurate. If you are using real devices, try to avoid using custom a lot of custom views because it will be sluggish in a scrollview. Try at least to use standard widgets and move the "custom" parts to another view, it's the simplest, most accesible, and easier to code solution to your problem.
A listview calling another activity would be the fastest and most user friendly approach IMHO.