QT widget design - square under main window
-
My setup is like this:
main.cpp:
//Window customization w.setWindowFlags(w.windowFlags() | Qt::FramelessWindowHint); w.setAttribute(Qt::WA_TranslucentBackground);Stylesheet:
#centralwidget { border-radius:20px; }And the widget then looks like this:
As you can see there's a rectangle att the bottom. How can I identify what element this is, remove it or if I cant, atleast cover it with the rounded widget by moving it up/moving main widget down?
-
My setup is like this:
main.cpp:
//Window customization w.setWindowFlags(w.windowFlags() | Qt::FramelessWindowHint); w.setAttribute(Qt::WA_TranslucentBackground);Stylesheet:
#centralwidget { border-radius:20px; }And the widget then looks like this:
As you can see there's a rectangle att the bottom. How can I identify what element this is, remove it or if I cant, atleast cover it with the rounded widget by moving it up/moving main widget down?
@StenGay said in QT widget design - square under main window:
As you can see there's a rectangle att the bottom. How can I identify what element this is, remove it or if I cant, atleast cover it with the rounded widget by moving it up/moving main widget down?
There is no "square" under your mainWindow... It's a part of it ;-)
Took me minutes of looking at the image to see what you are talking about. Better point to it directly in the image or something :)
Your the color scheme of your desktop background also doesn't help :)#centralwidget {
border-radius:20px;
}You only set rounded corners to your
centralWidgetand not the whole window.
The area below is exactly what is not part of yourcentralWidget.See:
If you dont need the
QMainWindowrelated stuff (menuBars, statusBars, etc) you could replace it with your inner widget. Then it should look like desired.Edit:
If I'm not mistaken, the part which bothers you, is the
QStatusBar.
Quick and dirty fix:
(I still would consider moving to a plainQWidgetand start from there)w.statusBar()->hide();You can even remove it from your UI file, if you design your base MainWindow in QtDesigner. Go to Design Mode, right-click on your MainWindow or on "MainWindow" in the object list at the top right and select "Remove StatusBar" or find the
QStatusBarin the object list directly and delete it. -
@StenGay said in QT widget design - square under main window:
As you can see there's a rectangle att the bottom. How can I identify what element this is, remove it or if I cant, atleast cover it with the rounded widget by moving it up/moving main widget down?
There is no "square" under your mainWindow... It's a part of it ;-)
Took me minutes of looking at the image to see what you are talking about. Better point to it directly in the image or something :)
Your the color scheme of your desktop background also doesn't help :)#centralwidget {
border-radius:20px;
}You only set rounded corners to your
centralWidgetand not the whole window.
The area below is exactly what is not part of yourcentralWidget.See:
If you dont need the
QMainWindowrelated stuff (menuBars, statusBars, etc) you could replace it with your inner widget. Then it should look like desired.Edit:
If I'm not mistaken, the part which bothers you, is the
QStatusBar.
Quick and dirty fix:
(I still would consider moving to a plainQWidgetand start from there)w.statusBar()->hide();You can even remove it from your UI file, if you design your base MainWindow in QtDesigner. Go to Design Mode, right-click on your MainWindow or on "MainWindow" in the object list at the top right and select "Remove StatusBar" or find the
QStatusBarin the object list directly and delete it.@Pl45m4 said in QT widget design - square under main window:
Took me minutes of looking at the image to see what you are talking about. Better point to it directly in the image or something :)
Your the color scheme of your desktop background also doesn't help :)Sorry about that 😄
Thanks for the reply, I'll try that once I get home to my computer!