Custom system tray icon "balloon tooltips" for Qt? - c++

I know that in the .NET framework there are a handful of alternative third-party controls for normal system tray icon "balloon tips", that allow you to change the colors and add some styling to the balloon.
I was wondering if there is something similar for Qt, which allows for better customization of the look, style, and feel of the balloon tooltips from a system tray icon.

You should have a quick glance at the "Qt Style Sheets" examples in QtAssistant. It provides strong and many ways to alter widgets looks and feel... Maybe you'll find something interesting there !
Otherwise, you could have a look at QSystemTrayIcon & QBalloonTip. Maybe by reimplementing those classes...
Hope this help a bit !

Related

How to create an Evernote kind of widget for global menu of a MacOS/X desktop using QT?

How to create an application which stays in top of MacOS, something similar to below image. You can see the Evernote elephant icon.
I don't want to use xcode - because my application already built in QT, it has nice GUI, now I wanted to add extended feature something similar to Evernote. If I click on an elephant it will open a dialog box to write notes. In my case- it's a simple event like on/off buttons.
I have tried and created GUI widget apps but how to make one which resides like Evernote app ?
A custom pop up menu like the one pictured can be done several ways in Qt.
QML is the most modern way of making the menu with the customized styling you are looking for.
Apply the appropriate flags to the window/widget so it appears as a popup.
The same effects can also be done in QWidgets, but takes more code and probably will take longer to make. The flags you are looking for will be found under Qt Window Flags and/or under Qt Widget Attributes.
The stock stylings for Qt for different OS's deal mostly with title bars, status bars, buttons, drop downs, etc.
The base styles for Mac can be found here:
http://doc.qt.io/qt-5/gallery-macintosh.html
Once you go to a customized popup, you have to draw all of it yourself... but the native drawing elements in Qt are friendly enough and get you that look you are trying to do.
There are even some tools for exporting from Photoshop or Gimp directly to QML.
http://doc.qt.io/qtcreator/quick-export-to-qml.html
Hope that helps.
You are looking for a tray icon. Qt implements it in QSystemTrayIcon.
Further information
You may take a look at the System Tray Icon Example.
Many StackOverflow posts exist on this topic.
If you already have a program written for Qt, then you can compile and run it under MacOS/X much the same way you could compile it under (whatever OS you're using now). You'll need to install Xcode because Xcode includes the C++ compiler (clang) you'll need in order to compile your Qt program, but you don't have to use the Xcode IDE if you don't want to. Rather, you can either use the QtCreator IDE under MacOS/X, or you can simply open up a Terminal window and do a "qmake ; make" in the directory where your Qt-based program's .pro file is, and build it from the command line that way.
If, on the other hand, your question is actually about how to add an icon to the global menu of a MacOS/X desktop, then I don't think Qt has an API for that, so you'll need to drop down to using one of MacOS/X's native APIs. That will probably involve learning some Objective-C (or Objective-C++, if you prefer), but integrating a bit of Objective-C/C++ into your Qt app is doable with a bit of work.

Qt mac switch between panels without changing window

I extensively researched this topic, mainly hindered by that I'm not sure I'm using the right words to describe my issue.
So the point is I'm developing a GUI application in C++ with Qt. The app is being developped on Mac and ftm it's intended only for mac deployment.
I want my app to behave much like System Preferences on Mac, thus accessing different views/panes by clicking buttons on the toolbar.
What I want to avoid is to have one separate window for each pane.
The closest thing I found seems to be QStackedWidget however I'm not sure what's the best way for implementing it.
Should I use it as the main class of my application? Or can I treat it as an object of MainWindow? I'm not a Qt Expert so any further insight or suggestion will be much appreciated. Thanks
QStackedWidget is definitely the way to go. Use it as your main 'container' for your widgets and implement a default main panel widget which contains your entry items, then when you click on one you can push it to be the currently displayed widget in the stack. You could try more complicated solutions to achieve it, but it's significantly easier to do with a QStackedWidget and then focus on how the interaction is handled.

QT4 C++ GUI Design - Tabbed interface alternative

Designing an interface with QT4 I have been advised that using multiple "Tabs" at the top of an interface to navigate different pages is not the most elegant design. Instead I would like to do something similar to the Options dialog in QT Creator 4.8.
Does anyone know the name of a widget that resembles that in the Options Dialog of QT Creator.
ex. Click Tools->Options... In QT Creator.
Notice the layout on the left hand side of the screen, which to me seems nicer than only tabs across the top of the screen.
Thanks for your help!
It's QLiveView/QListWidget with delegate that draw icon and string.
Here is link to documentation for QListView, If you are not happy with default list view delegate then you can create your own QItemDelegate to handle custom drawing. Here is sample code to create custom QItemDelegate
I just stumbled upon this implementation of a ribbon interface this morning. Maybe this is helpful to you?
http://qt-project.org/forums/viewthread/4214

Custom Location of the Main Menu of Windows Dialog

There are a lot of articles related to customizing main menu of the dialog window on, including "custom-drawn" menus. But none of them seem to answer my question.
I have a (borderless) window that has a custom-drawn by hand title bar:
I need to display somehow a main menu under this "fat" title bar. How could I do this, using MFC? By default "native" menus seem to be able to be located only in the top of the client area of the dialog window (or am I wrong here?). Is there any solution for my problem?
If someone could give some links related to my issue, I'd greatly appreciate this! I've seen a lot of products that implement this, for example Ontrack comes on mind, but never met any explanation on how this was achieved.
Thank you!
I need to display somehow a main menu under this "fat" title bar.
That's precisely where it is being drawn, according to the image you posted.
By default "native" menus seem to be able to be located only in the top of the client area of the dialog window (or am I wrong here?).
No, that's correct. The menu will be automatically drawn where menu bars belong: at the top of the window, just below the title bar.
You've decided to mess up the defaults and throw usability of your application to hell by reimplementing the non-client area. That means you can't rely on Windows to draw these elements for you. Instead, you'll need to take responsibility for drawing all of these things yourself, which requires you to write code to do so. I don't know what "Ontrack" is, but any application that does this is owner-drawing its menus.
Another popular option (used by Internet Explorer for a while) is to create your own menu-like object using a rebar control. This has the advantage of integrating into an existing toolbar control and allowing the user to rearrange items as desired. It, like writing your own menu control, has the disadvantage of not conforming to standard platform conventions and user expectations (although it's probably a lot better than whatever you can come up with yourself). There's a how-to article here on MSDN.
I suspect that in undertaking this project you've probably bitten off more than you can chew. Keep in mind that there's hardly ever (if even that) a reason to draw your own title bar. As you're seeing, conforming to your platform's standard expectations is often easier on the programmer and far better received by your users.

Creating a window that can only be dragged within the parent window

I have a WIN32/C++ app and I want to create child windows in it that cannot be dragged out of the parent window. I want these windows to be owner-drawn, if it matters anyway. Should be simple enough; I'm looking for some basic guidance and tips regarding the subject.
It seems that you want to make an MDI app. This is much easier using a higher level framework such as MFC, WinForms, VCL etc., but can, of course, be done with plain Win32.
The MSDN documentation can be found here: Multiple Document Interface.
What you are looking for is called Multiple Document Interface (MDI).