Qt 6.11 is out! See what's new in the release
blog
Window that does not appear in taskbar and can't alt tab on
-
Hi, you can use the old ToolWindow style, to try, create an empty vanilla Widget app, add this to the .pro file:
LIBS += -luser32Then change mainwindow.cpp to this:
#include "mainwindow.h" #include "ui_mainwindow.h" #include "Windows.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); HWND hWnd = reinterpret_cast<HWND>(winId()); LONG_PTR exStyle = GetWindowLongPtr(hWnd,GWL_EXSTYLE); SetWindowLongPtr(hWnd,GWL_EXSTYLE,exStyle | WS_EX_TOOLWINDOW); } MainWindow::~MainWindow() { delete ui; } -
Hi, you can use the old ToolWindow style, to try, create an empty vanilla Widget app, add this to the .pro file:
LIBS += -luser32Then change mainwindow.cpp to this:
#include "mainwindow.h" #include "ui_mainwindow.h" #include "Windows.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); HWND hWnd = reinterpret_cast<HWND>(winId()); LONG_PTR exStyle = GetWindowLongPtr(hWnd,GWL_EXSTYLE); SetWindowLongPtr(hWnd,GWL_EXSTYLE,exStyle | WS_EX_TOOLWINDOW); } MainWindow::~MainWindow() { delete ui; }@hskoglund I see, it gives the same result as doing
setWindowFlag(Qt::Tool). -
Yes you're right, didn't know about that flag. Also easier than have to #include "windows.h" etc.
Anyways, hope that this ToolWindow style is what you're looking for.
@hskoglund It seems to be working quite well.