Setting a different title on tap as on header of a QDockWidget - qt

I'm currently writing an application in PySide where I want to have multiple DockWidgets available for the user to move around freely.
In the title of my DockWidget I want to have a solid black line and no text, but in the case of having some DockWidgets tabified I want them to show a title on the tabs and only on the tab bar.
For the normal header I used a widget which has just one background color (set in a css file...).
Does anyone know of a simple way to get this done?
Thanks in advance!

Related

What is QScrollBar::add-line?

From the docs,
The ::add-line subcontrol can be used to style the button to add a
line. By default, the add-line subcontrol is placed in top right
corner of the Border rectangle of the widget. Depending on the
orientation the ::right-arrow or ::down-arrow. By default, the arrows
are placed in the center of the Contents rectangle of the add-line
subcontrol.
What's the mean of "style the button to add a line"? What's the appearance of a line? How is it shaped? What's the function of such a line?
AFAIK, a scroll-bar is consist of a background rectangle, two arrow buttons and a rectangle act as the handle:
the button to add a line
This is the button that adds a line in your scroll-area (in the direction of your scrollbar, horizontal or vertical), i.e. to scroll one line (down/right, the sub-line control will scroll one line up/left).
This is just the regular button with an arrow that you already identified on your screenshot. The default button and behaviour for scrollbars as we see them in most of GUIs.
This one line is actually called single step in the QAbstractSlider doc.
These stylesheet controls QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal, QScrollBar::add-page:horizontal, QScrollBar:left-arrow:horizontal etc allow to customize the look of these parts of the widget.
The other control QScrollBar::add-page: will allow you customize the widget area that scrolls not just one line but one page.
The size of a page can be defined by setPageStep(int) while the size of the one line can be defined by setSingleStep(int).
There is no button to add/sub one page-step. Instead you have to click in the empty space between the handle and the buttons to add/sub one line.
From what I tested (Qt5.10) this will be processed only if you also customize the QScrollBar as well. The example of the doc given by Scheff Customizing QScrollBar shows a full usage of what you can customize on a QScrollBar.

Auto-size home icon bar

I'm using an app for add video support to Wagtail: wagtail-embed-videos.
This app add a new icon in the icon bar but is not properly sized, i mean,
icon isn't in the same line, is putted in the botton.
I want icon in the same line, like this:
In order to put all icons in the same line we can change the width value; make permanent this change require recompile statics, ok.
My question is, have we make it by own hand or you can add support for more
than three icons in the icon bar?
Thank you!

QT Tab bar's top highlight with stylesheet

I have a problem when trying to change the color of QTabBar's top line (blue line in the picture below).
Is this a separate part of tabBar (like scroller or tear) or its top border ? And how can I change its color with styleSheet and leave the other parts of tabBar unchanged?
P.S. : My tabBar::styleSheet returns an empty string, so I can't get current style and make changes in it.
If you're using a "system" style, you may not be able to change the color of the line (cause representation of UI elements is not handled by Qt but by the system).
You should define a complete style for QTabBar (and maybe QTabWidget too) that you can customize as you wish.
See the Qt Style Sheets Examples page.
Problem solved:
setStyleSheet("QTabBar::tab:selected { selection-background-color: red; }");

Qlabel with image as the background overlaps other Qlabels

I have a Qlabel with image as rich text and some other Qlabels on top of that as in the picture:
although I sent the Qlabel with image to back but when I run they appear as follows:
is there anyway to fix this?
Make the text labels children of the label containing the fade. Also I can not see any layouts. Did you use layouts? You could also put the fade on the widget by implementing its paintEvent(). All other widgets will be displayed on top of that.
Try right clicking the image label and clicking the send-to-back option. That might work. That should send the QLabel behind the other elements even though they appear as though they are already in front.

Ionic Platform custom midle tab

So i having problem to customise in bottom tabs the middle, i want to make middle tab height bigger then other tabs, so i cant find the way to customise it. It would be nice if there would be somebody that can help with this.
Link for editing link. And wanted result image.
Tried separately change the hight but, there are a feeling that flex box doesn't allow to tab go out of content.
Inherit the CSS class that holds the icon in the middle and add your custom properties.

Resources