Unsolved Window top edge, unable to control it
-
Hello,
Im trying to customize a QMainWindow, so i want a customized title bar, so far i figured out it is controled by the os.
So i disabled it using :
w.setWindowFlags( Qt::CustomizeWindowHint );
Then i created my custom title bar beside i had the issue that the menu bar is on top of it, so i created my own menu and placed it under the custom title bar. so far the result looks good the way i want it.
I also use a style sheet from github to turn the entire window into dark mode.
Still remainds a small detail, the top edge of the window, stays white or os color, it is not affected by the dark theme, and i dont know what is that and how to control it, just when the mouse goes over it, i can resize the windows (witch is a behavior i want to keep)
but i want to be able to hide it or change it color and thickness to make it match the window theme, how can i do that ? here is a screenshot :
so area 1 is the issue, the line i want to control.
area 2 is my customized title bar
area 3 is my customized menuthanks.
-
@Xena_o said in Window top edge, unable to control it:
w.setWindowFlags( Qt::CustomizeWindowHint );
What flags did you set/unset after this?
What environment is your application running in? Windows, Linux (what window manager), Mac
What stylesheet? -
@ChrisW67 i am just using this flag i mentionned wicth removes the titel bar only, nothing else.
w.setWindowFlags( Qt::CustomizeWindowHint );
Im under Windows 11, Qt 6.5.1, C++, but i need it portable to MacOs and Linux.
Stylesheet on github click here
the stylesheet is not involved into the issue, because without using it, the top bar stays white in all cases.
code to load the stylesheet in main.cpp :
QFile sf(":qdarkstyle/dark/darkstyle.qss"); if (!sf.exists()) { qDebug() << "Unable to set stylesheet, file not found"; } else { sf.open(QFile::ReadOnly | QFile::Text); QTextStream ts(&sf); qApp->setStyleSheet(ts.readAll()); }
-
there probably a solution on this code
however this code works only with Qt5 so it needs to be adjusted for Qt6.
Also its kinda gas station for such simple thing.
if i can avoid to do this all, that would great.