Standart window title buttons style - Close and Minimize - qt

I need to make buttons that look like standard window title buttons with their icons (close/minimize) in the current operating system (win / osx / linux). Is there a possibility in qml?

You take screenshots (or google for images) of those buttons in their different states (enabled, pressed, highlighted, normal e.t.c), than you style your Buttons to show the right image at the right time.
Which set you need to choose, depends on the OS, which you can query with
Qt.platform.os
Depending on the usecase, it might be worth to investigate the possibility to use real Windows, if you are planning on building some kind of subwindows. Might prove complicated, though.

Related

How to resize the designer-space in qt-creator if needed when developing?

As I am putting more widgets on top of more layouts in my application, the space where I design the GUI is getting also bigger for the Qt-creator interface.
I have many buttons and frames which are out of reach. I cannot see them (or click them, of course). I don't know how they look until I run the whole application for debugging.
Is there is a way to zoom out/in the main frame (the whole playground) so that I can see my full GUI design on the UI of Qt IDE?
P.S.: I am working on macBook 13"
Zooming is not possible. You can use Tools -> Form Editor -> Preview.
If the viewport gets too small the QtCreator shows scrollbars which allow to move the part of interest into view.
Note, on some system configurations the scollbars may be very small and hard to handle.
You can use this steps
Tool-->options-> Text editor ->zoom
Text editor

Change behavior of mouse buttons - do I have to write a driver? (Sharkoon Drakonia)

I just bought a Sharkoon Drakonia (just for information). It has 11 buttons, but only two of them (except left, right and middle button of course) can be used as 4th and 5th mouse button (eg. in games), the other ones can only be modified to behave like a double click etc. via the configurator software shipped with the mouse. So I wondered if there is a way to completely change or remap (some of) the mouse buttons to be recognized in games as for example "Mouse 6" and "Mouse 7". I think I have to write a driver for it, am I right? Is there another way to achieve my aim?
Thank you in advance!
You don't necessarily have to write a new driver - you can use some input remapping software like GlovePie (google for it). It has its own scripting language to program how input works. Most people use it to make console controllers behave like a mouse, keyboard or combination of both... But I've used it to make things kinda like what you want.
There are other software like GlovePie that can also do the job, but it's the only one whose name I can remember right now.
edit: I've just read your question more carefully. You may not be able to make a software see a mouse6 or mouse7, but you can bind some action in a game to a key in the keyboard, and then map your extra mouse buttons to be seen as if they are those keys. It works just fine.

Hide Navigation Bar in flex

I'm newer in Flex and I would like to disable the Navigation Bar and the bookmarks tab cause I need to show a lot of information so I really need to have as much space as it's possible. I do not know what I can do.
Thanks in advance,
Alicia
Do you mean the navigation and bookmarks in the browser?
Depending on the content of your application, you could potentially use full screen mode, but that has some restrictions around keyboard input (only some keys are allowed such as arrow keys, enter key etc)
Otherwise you may just need to prompt the user to turn their browser to full-screen so that they can see as much of the app as possible.
Browser full-screen/maximise is different from Flash full-screen as all keyboard input is still possible.
As far as I know there wouldn't be a way to actually modify the appearance of the browser from within a Flash application.

Qt switching between views

How do I switch between the two screens on the Qt?
For example, I have a button - static text plus a toolbar. Now I will add it to a frame and set it as a central widget. It works well for one window. What if I move it to the next window? Then I need to show some other stuff like another button, some images etc... and what if I come back to the first view again?
How do I show my old widgets back?
I'm not sure I got your problem right but, you could have different scenarios :
You could simply use groupboxes... Some widgets in groupbox1, otherWidget in groupbox2, and you display the groupbox you want to use, hiding the others...
You could use stackedWidget, which simulates "pages" of widgets stacked on top of eachothers... more informations here : http://qt.nokia.com/doc/4.6/qstackedwidget.html.
You could use other way like using tabs : http://doc.trolltech.com/4.6/qtabwidget.html
Maybe this example would be useful to you : http://qt.nokia.com/doc/4.6/dialogs-configdialog.html
Hope it helps a bit !
I'd recommend checking out Animation/States example (should be in /qt/examples/animation/states/ subdirectory of your Qt installation). It shows how to combine state machine representing application logic with presentation layer and get cool animation effects for free (of course if you don't need eye candy, you can set widgets properties without any animation).

Custom Application Icon for processing app

I've written a small Processing App which I'm planning to release soon. What's still missing is a sweet custom icon for Titlebar/Taskbar (Win) and Dock (Mac). Any suggestions how to do this?
Thx!
Meanwhile I figured it out on my own:
Obviously this works for Mac OS by replacing the sketch.icns file within the exported app, for win & liunx is done by adding this line to your setup method:
frame.setIconImage( getToolkit().getImage("sketch.ico") );
It depends if you have any artistic ability or not.
If not, then you can hire an icon designer to do one, or search the web for free icons - there are billions.
If you have a modicum of artisticness, then you could grab a free icon that is almost what you want and then tweak it. IcoFX is a great free application for doing this sort of thing.
If you think you have what it takes to draw an icon from scratch, then a good plan is to use a vector art package. This allows you to export the same graphic at multiple resolutions so you can get top quality at every icons size you need (from 16x16 to 256x256). Alternatively, draw a large (512x512) verison in a bitmap editor and then downscale it as required. As long as you start big and downscale, you shouldn't have any problems (although to get a good icon at 16x16 and 32x32 you will still need a good eye and a lot of manual tweaking).
In your code, just type this line:
frame.setIconImage( getToolkit().getImage("sketch.ico") );
For Windows/Linux, this will do it. For Mac/OSX, follow these steps:
Find your sketch in Finder
Right click > info, or CmdI
Find your icon and open it in Preview
In Preview, click on your icon and press CmdA or right click > select all
In Preview, press CmdC, or right click > copy
Go back to Finder. Click on the current icon of your sketch. You'll know you've selected it when a blue outline appears. Press CmdV, or right click > paste
Tips:
The standard icon size is 512x512
When making your icon, make sure that your transparencies are working

Resources