Set application theme in Qt [duplicate] - c++

This question already has answers here:
Can I run a Qt application with a specific theme?
(2 answers)
Closed 6 years ago.
Is there a way I can set the application theme from inside my application's own code?
For example, a function like that:
setApplicationTheme("Plastique");

You can use this function:
QStyle * QApplication::setStyle ( const QString & style );
Take a look at the Qt docs:
Qt 5
Qt 4.8

Related

How can I color behind text in the console application? [duplicate]

This question already has answers here:
How to change text or background color in a Windows console application
(3 answers)
Closed 2 years ago.
How can I color behind text in a Windows 10 console application? (you can look at the picture as an example)
Use WriteConsoleOutput, see this for details: https://learn.microsoft.com/en-us/windows/console/writeconsoleoutput

Force windows 10 tray icons to be visible [duplicate]

This question already has answers here:
Force Windows to show a system tray icon
(5 answers)
How to always show program tray icons in Windows by *default*?
(3 answers)
Set tray icon to always show
(5 answers)
Closed 2 years ago.
I have an issue with a software I wrote (Delphi) that is minimized to Windows 10 tray icon locations. There are two possible locations, one at the end of arrow #1 and another into arrow #2.
When a new application is installed, by default when minimized (and code written to take care of this), it goes to location #2 by default, and some user are confused and thinks the software has crashed (because this is hidden). My question is simple, is there a piece of code that forcefully put the minimized app icon into location #1 directly without any action from the user ?
C++ code is OK, or Delphi would be very nice.

Thumbnail for running application on Windows [duplicate]

This question already has answers here:
How does Windows 7 show the thumbnails of application in taskbar?
(2 answers)
Closed 5 years ago.
Is there any Win32 API that provides the thumbnail to a specific application running on Windows? I notice Window captures these thumbnails when we hover the mouse over the taskbar but is this exposed to developers?
I'm coding in C++ and expect the API in C++.
These "thumbnails" are parts of Windows itself and cannot be modified.

Hide window in MFC C++ [duplicate]

This question already has answers here:
Hide an MFC dialog window
(6 answers)
Closed 9 years ago.
I have an MFC C++ app, I need my app to run in background, to do run some functions.
So I want to disable the dialog window .In other words I am trying to hide/make it invisible to the user.
How could I do this ? I don't have much experience with MFC, I would really appreciate the help.
Bye.
You need to hide the mainframe using ShowWindow(SW_HIDE).
Refer ShowWindow.

Qt - setupUi( ) [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Qt - initializing the form
I tried to look for a description for the setupUi() method but couldn't find especially in the Qt documentation.
What does this method do? For example, if I write in a class setupUi(this), what will this do? What does setting up a user interface mean at the end?
Thanks.
setupUi() creates the actual instances of widgets for you. A form that you create in QtDesigner is stored just as XML file. So to be able to build the actual "window" with all the elements that you put on it in QtDesigner and display it in your application, setupUi() is created for you automatically by UIC (UI compiler - a Qt tool) so you don't have to do that manually. All the properties that you set in QtDesigner and all elements you put there will be "translated" in C++ code like this:
QLabel *label1 = new QLabel(tr("Start"), this);
QTableView *view1 = new QTableView(this);
...