How can I make custom frame border in QML - qt

I want to make cross-platform app in Qt Quick - QML.
Something like this:
But don't know - how to make this, because of rounded corners in Win 11.
App will starts on both Windows (10 and 11)
And frame icons (hide, close, fullscreen) and corners should me standart, but "S" logo - not.
Can you help me with advice how to code this or what do you see as a possible solution?
Thanks!

We need to make frameless borber by flag:
flags: Qt.Window | Qt.FramelessWindowHint
We need to separate title on 2 pieces (left, with Logo, and rigth, with buttons). Rigth side can be made by WinApi, or QML.
Rigth side can be made only by custom QQuickPaintedItem:
Example here: https://gist.github.com/oKcerG/b9527a638b01523c3c9c06647d373338

Related

JavaFX 2 - Autoscroll to last item in exceeded toolbar

I am creating File Manager like Miller column app for windows in JavaFX for learning purpose.
Check the screenshot below:
As you can see, when toolbar exceeds, there comes a double arrow button for more items to select from popup.
I already did auto scroll for miller column, which works as expected.
scrollPane.hvalueProperty().bind(hBox.widthProperty());
I would like to auto scroll toolbar to last item and show double arrow on left side.
I am adding adding clickable buttons in toolbar for traversing like manual BreadCumBar.
Tried ControlsFX BreadCumBar, it doesn't even show arrows or popup when exceeds, Bug here : https://bitbucket.org/controlsfx/controlsfx/issues/810/no-double-arrow-popup-like-when.
If its not possible to do so with toolbar, I would like to know how to customize toolbar popup only via css. Or any other way that improve usability easiness.
Also I would love to know suggestions for whole app from expert designers.
Thanks.

How to change QIcon color?

I am working on a custom control box (that min,max/restore/close button in the top right of your Windows titlebar) for my new application. I use closeIcon = style.standardIcon(QStyle.SP_TitleBarCloseButton) to get the correct icon for them. See the full code here in my other SO question. What I got is a black icon. In which I need the white version when it's in hover state.
Can we .. I don't know, inverse it? Or should I get another icon from QStyle?
This question (and several others) are from the intention of creating a chrome like tab in PyQt application, by hiding the titlebar and reimplementing control box. But it didn't gives the best result. Right now this is my solution to create a chrome like tab in PyQt application. Therefore, I close this question.

Window flags not helping in mdiarea in Qt

I am using Qt and creating a GUI with multiple sub windows. I am using MDI Area for the same. I want to hide the top toolbar of mdi subwindow but using window flags is not helping.
I have tried writing the code as follows. First I tried for mdiarea and then for subwindow but neither worked.
mdiarea.setWindowsFlags(Qt::FramelessWindowHint);
subwindow.setWindowsFlags(Qt::FramelessWindowHint);
I have also tried using Qt::CustomizedWindowHint but even that is not helping. Please help me with this.
Thank You.
Try this:
mdiArea->addSubWindow(new QLabel("Qt::FramelessWindowHint"), Qt::FramelessWindowHint);
You don't want to set the MDI area itself as a frameless window, because it's a widget you likely have embedded in another window... it most likely already doesn't have a frame.
Your setting the 'subwindow' should work... but addSubWindow(myWidget) actually wraps the widget passed in in the real subwindow, so that's what was going wrong. Qt lets you pass in window flags as the second parameter of addSubWindow() and those flags go to the real subwindow.
Note that with a frameless window, you can't drag the window around to move it, or grab the edges to resize it, because there's nothing for you to grab onto!
If you just want the minimize and maximize buttons gone (but still want the close button), try passing Qt::Dialog instead.
Try also experimenting with these:
addSubWindow(new QLabel("Qt::Tool"), Qt::Tool);
addSubWindow(new QLabel("Qt::Tool|Qt::CustomizeWindowHint"), Qt::Tool|Qt::CustomizeWindowHint);
addSubWindow(new QLabel("Qt::Dialog"), Qt::Dialog);
I think Qt::Tool|Qt::CustomizeWindowHint is probably the best option (no buttons, but still movable and resizable - if you don't want it resizable, give it a fixed size (setFixedSize()).
Edit: Also try: Qt::CustomizeWindowHint|Qt::WindowTitleHint

Qt5: how to resize two UI lists against each other

I would like to be able to resize two QListWidget that sit in a QVBoxLayout, by grabbing the edge in the middle of the two and sliding it up or down. One would shrink, the other would get bigger.
Here is a screenshot of a sample app:
I would like to be able to grab the bar between the two lists and resize them.
This is what it looks like in the Qt layout editor:
I'm not sure if the vertical layout is the good choice, here, there may be another vertical layout that provide this functionality maybe?
Is it even possible with Qt?
You need to use QSplitter. It's available in the form designer.
To add to Riateche's correct answer, you can also use qt-designer to add specify the type of layout (QSplitter) by first selecting the widgets and then right-click to layout->horizontal splitter etc.
Here's a simple tutorial I ran by a few years ago: http://www.youtube.com/watch?v=E7Ud6FonsR4

Prevent Subwindow Resize

:D
I'm a Qt beginner and I have some problems.
Generally, all the languages and tools that have an GUI builder have for the window the "Resizeable" property.
Very well, I need to do the same in Qt:
No window resize, no resize pointer in hover the window's border, maximize button (in the window's title) disabled.
I'm tried to find something but unsuccessfully.
If someone help me, I'll be grateful.
Hug.
Sorry for my english. I'm brazilian. :)
In Qt Creator, I think you can create a non-resizable window by giving it the same minimum and maximum size.
Or you can do it by code using setFixedSize. In that case, just add this line in your window's constructor:
setFixedSize(size());
Use void QWidget::setWindowFlags ( Qt::WindowFlags type ). see enum Qt::WindowType for the list of flags you can play with.
For instance, setting Qt::Dialog | Qt::FramelessWindowHint should produce a windows without resize frame and no max/min button.

Resources