Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGoodCentralWidget vs QGoodWindow? #64

Open
PaddleStroke opened this issue May 13, 2024 · 5 comments
Open

QGoodCentralWidget vs QGoodWindow? #64

PaddleStroke opened this issue May 13, 2024 · 5 comments

Comments

@PaddleStroke
Copy link

I'm not sure to understand what is the purpose of QGoodCentralWidget, and when to use it.
It would be good to have a bit more doc to explain it.

@antonypro
Copy link
Owner

@PaddleStroke:

QGoodCentralWidget is a optional QWidget to be used with QGoodWindow to make easier to implement a title bar, window border color and many things that helps to easily implement a frame less window.

I must agree with you that now it lacks some documentation of it's purpose, i'm planning to add that in the future.

Thanks!

@PaddleStroke
Copy link
Author

Hmm, I'm still a bit confused because QMainWindow central widget is like so :
image

so it is inside the toolbars area, and the dock areas are also surrounding it. QGoodCentralWidget seems to be the widget that you define as the QMainWindow central widget, so I wonder how it is doing the title bar, window border color etc which one would expect to be defined in QGoodWindow?

@antonypro
Copy link
Owner

@PaddleStroke:

When using QGoodWindow you must use only the central widget, use of status bar, toolbars and dock widgets gives to you weird results. However you can still using widgets, and it includes use QMainWindow as QWidget child, for example, of QGoodCentralWidget, in this case you have QGoodCentralWidget coordinating and sometimes controlling QGoodWIndow, and you can use Tool Bar, Menu Bar and Status Bar in this QMainWindow widget.

In order to see exactly what is QGoodWindow and QGoodCentralWidget you could see the docs and the Examples.

Thanks!

@PaddleStroke
Copy link
Author

PaddleStroke commented May 14, 2024

So do I understand correctly :
If we want to use toolbar/statusbar/dock area... then we need to add a child QMainWindow to the QGoodCentralWidget ? So the structure would actually look like this ?
image

The QGoodWindow has only the QGoodCentralWidget (no menubar/statusbar/etc).
The QGoodCentralWidget has a vertical layout with the custom title bar. Then a QMainWindow.
The child mainWindow can have toolbar, dock area etc.

Is that right?

@antonypro
Copy link
Owner

@PaddleStroke: Yes!

I want just to add a note for menu bar:

If you want your child main window menu bar in the title bar, you have to add it manually to QGoodCentralWidget as left, center or right widget, or fuse the central widget and the title bar, and add a place holder widget or a title bar mask to make the menu clickable.

BTW, you can fuse central widget with title bar to make the central widget "invades" the title bar if you like, and selectively hide title bar icon, title bar title and title bar caption button, and replace it with yours respective implementations.

See the API of QGoodCentralWidget: setUnifiedTitleBarAndCentralWidget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants