Is it possible to create a tray applet with Qt? - qt

I want to make a tray applet using Qt that will use an output from a bash script to show some basic info. Is that possible to do in Qt? I wasn't able to find any tutorial via google, though.

What about the System Tray Icon Example?
(Please note that the term "applet" is something different than the term "tray icon". The former is used for something more than just an icon and in most cases (which is very system dependent) a background process and placed by the user into the tray bar, where your tray icon is put in the system tray bar by a foreground application.)

Related

Anyway for azerothcore to go the background or system tray?

I want to know if you can put authserver and worldserver to the background. I know mangos do this and since in the end, Azerothcore is based on mangos so I'm wondering if Azerothcore can still do this.
Or another way I do it for windows is use RBtray
RBTray is a small Windows program that runs in the background and allows almost any window to be minimized to the system tray by:
Right-Clicking its minimize button
Shift-Right-Clicking on its title bar
Using the Windows-Alt-Down hotkey
Note that not all all of these methods will work for every window, so please use whichever one works for your needs.
Just a guess that your trying to move console windows to system tray?.

Build photo editor interface using Qt

I would like to create an application using Qt (PyQt5 specifically) that has a photo editor like interface. More specifically, I would like it to have:
No main window
Free-floating toolbar
Free-floating context window
Startup dialog
Edit-windows
The idea is to have the toolbar and context window persist for as along as the application is running. The user then opens one or multiple documents (e.g. images in the photo editor example) and uses the options in the toolbar to modify the document(s).
My first question is; does this type of application interface have a specific name, something akin to MDI or SDI? I've been searching for "photo editor interface" and variations on that, but haven't been able to find a search string that seems to hit the mark. For instance, I've tried "build a photo editor type interface with Qt" but it doesn't yield anything useful.
The second question I have is, what is the best way to build a Qt application that doesn't spawn a main window? It seems like I could kludge an assortment of dialogs together to make this happen, but I would really like to use a lot of the functionality of QMainWindow (toolbars, menus, top-level management of the application). Is there a way to launch QMainWindow, display the menu and toolbar, but suppress the main window?
I plan to primarily use this application on OSX, but would also like it to perform well on Windows and Linux.
QMenuBar has explicit support for OSX to have the menu bar behave as expected: http://doc.qt.io/qt-5/qmenubar.html#qmenubar-on-os-x
I think it'll also work on Ubuntu's Unity, which tries to have similar style, but there may be some details you need to take care of. Other desktops should work as expected.
As to how to have individual windows: any Qt widget will be a top level window if it has no parent, so that is an easy way to create windows. If you want to have parent windows (for example to control window stacking order automatically), there's a window flag for that. So you don't need to use QDialog (not sure if you were implying that in your question).
You want to read QWidget documentation carefully to get an idea how all this works.

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

Java FX system tray message

I'm developping an application that needs to run silently in the system tray.
That's why i used this SOLUTION first to hide my application in the System Tray, which is working really nicely.
However at some point my users will need to be notified about things. Like on Skype or Msn, when you get a message you are being notified of it with a popup in the right bottom zone of your display.
I'm looking for a way to reproduce this, i couldn't find anything in the java.awt.SystemTray doc. Is there any native class doing this or should i try to reproduce it by generating a window myself ?
First there is the answer from JavaFX: what is the best way to display a simple message?. This uses a custom popup as javafx from java 8 could not be used by the implementor.
If you can use javafx2 (the one with java 8) you can look at the Controlsfx library found here: Notifications with Controlsfx

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