Customizing QHeaderView resize handle - css

I use the cleanlooks style for my application which fits best the look and feel I want.
The annoying thing a stumbled on is that the QHeaderView (horizontal header of a QTableWidget for instance)
doesn't paint the resize handle between sections when running uner an Unix host.
what I want:
what I get:
I started to search a solution using style sheets but it seems there is no way to control the handle rendering.
Do I have to play with borders style ?
Is there anything obvious thing I am missing?
I don't want to subclass QHeaderView or QStyle for such a little (trivial ?) problem.
Any help appreciated.

Here is what i found so far:
QHeaderView::section:horizontal{
margin-top: 4px;
margin-bottom: 4px;
border-style: solid;
border-left-width: 1px;
border-left-color: white;
border-right-color: darkgray;
border-right-width: 1px;
}
QHeaderView::section:horizontal:first{
border-left-color: darkgray;
}
which gives this result:

Related

How to customise slider thumb's shape with CSS and Webkit?

I know how to customise some properties of a slider's thumb with CSS and Webkit.
E.g.:
#slider::-webkit-slider-thumb{
box-shadow: 0px 0px 0px #000000;
border-radius: 50%;
border: 3px solid #0ac2ac;
background: #0ac2ac;
cursor: pointer;
-webkit-appearance: none;
cursor: grabbing;
height: 15px;
width: 15px;
}
Instead, I do not know and failed to find on the Web how to customise a slider thumb's shape by using CSS and Webkit.
I wish to use a polygonal shape instead of the slider thumb's default round shape.
Is there a way to do that by using CSS and Webkit? If not, what is the most efficient alternative solution for achieving my purpose?
Thanks!
I solved it by adding clip-path: polygon(<path>) and changing background: <colour> to background: url("<entire svg code>") to the style shown in my question.
I run into same task recently, I am using somewhat similar css as the question posted,and also stuck on the same issue.
In my case, it seems that I have to add margin-top to let it work.
I added:
margin-top:-8px
If I don't add it, it will always be the blue circle.

Can not read border style from pseudo elements in Microsoft Edge and IE

In an web project that I'm working on we use JavaScript to render big, complex web pages. We are currently working on a way to be able to move parts of the page to another tab/ send the content as a string and render the same content on another computer/browser looking just as the original page.
We could use the same scripts to rerender the page but when rerendering performance is of utmost importance and therefore we want to avoid it. So our approach has been to iterate over the relevant elements and abstract the elements together with their current styling using getComputedStyle(). This method works well, however we have encountered some problems including pseudoelements.
To include them we have gotten the styling using
getComputedStyle(element, ':after');
which works well in Chrome. However, In IE and Microsoft Edge this only works most of the cases. One case that does not work is if the pseudo element has a border. Then the border-style is not included in the CSSStyleDeclaration returned from the function.
So my questions are:
Are there any better ways to get the pseudo element stylings that bypasses this problem?
Is there any other(better) approach to the problem at hand?
Minimal example reproducing the error in fiddle. When clicking the button Chrome outputs:
border-bottom: 1px solid rgb(255, 0, 0)
border-bottom-color: rgb(255, 0, 0)
border-bottom-style: solid
border-bottom-width: 1px
while Edge outputs:
border-bottom:
border-bottom-color: rgb(255, 0, 0)
border-bottom-style: none
border-bottom-width: 1px
I'm sure you have solved this another way by now... but as the problem still exists today in Edge; here is a work-around for it.
The issue is that for border-style IE is returning the parent elements value instead of the pseudo elements, so if you set the style there, and give it no width, the pseudo element will inherit it. Extracting from your fiddle to example...
#pseudo-element-test-id {
position: relative;
border-bottom: 0 solid;
}
#pseudo-element-test-id::after {
position: absolute;
top: 15px;
left: 0;
content: " ";
width: 150px;
border-bottom: 1px solid red;
}

Minor change to QComboBox's stylesheet hides dropdown arrow

I'm messing about with stylesheets in Qt. I have a QComboBox that I have styled in QtCreator with this:
QComboBox::drop-down {
border-left-width: 1px;
border-left-color: red;
border-left-style: solid;
}
This effectively adds a small red border to my drop down, but it also makes the drop down arrow disappear? Why is that? Do I need to add anything else?
Thanks a lot!

ie8 not picking up background colour

I've a Joomla3 website with a custom template looking fine in most browsers but awful in IE8. Lots of the elements just don't seem to be picking up background colours and are just white.
For instance the footer normally has a background colour. When I look at the template.css file (compiled from bootstrap and my custom template.less file) you can see the footer formatting
.footer .container {
padding: 5px;
border: 3px solid #bbbbbb;
padding-top: 0px;
border-top: 0px;
-webkit-border-radius: 0px 0px 4px 4px;
-moz-border-radius: 0px 0px 4px 4px;
border-radius: 0px 0px 4px 4px;
background-color: rgba(245,248,250,0.7);
}
But when I use the website development tools of ie8 (via wine on my mac - in case that makes a difference) to examine why it is just white in ie8, I see
which seems to show that the background-color of .footer .container is just being ignored.
Why would this be? Is this because it's compiled into a rgba format by the less compiler?
Many thanks for any help on this and how I might solve it.
CSS3 colors, such as rgba() are not supported by IE8, that's why it's not working.
You will have to take an alternative approach for specifying the background-color if you want support in IE8. If you don't mind losing the transparency, just use background-color:rgb(245,248,250); or.. background-color: #F5F8FA;
See http://caniuse.com/css3-colors
What you can do is import css3.js in your website. This javascript files allows you to use CSS3 attributes that will work on older browser that wouldn't usually support it.
http://imsky.github.io/cssFx/
Once you've imported that, you can use the following as you were before:
background-color: rgba(245,248,250,0.7);
Just to be on the safe side, I think it's always good practice to have a fallback, just incase, like so:
background-color: #F5F8FA;
background-color: rgba(245,248,250,0.7);
Note that the fallback comes before rgba()
Hope this helps
I encountered this same issue when using IE11 in enterprise mode.
I had this style set:
.heading {
background-color:#f1f1ef;
border-style:solid;
border-color:#E4E3DD;
border-width:1px;
}
and my table heading did not have the background color:
<th class="heading">Test</th>
I had to manually set a property bgcolor for this to work in Enterprise mode:
<th class="heading" bgcolor="#f1f1ef">Test</th>

customizing tab control in stylesheet in qt

I would like to do changes only for a specific tab. How can I do it?
I tried both:
QTabBar::tab#tbGeneral{... }
QTabWidget::tab-bar#tbGeneral{... }
None worked.
You have probably looked into Customizing QTabWidget and QTabBar.
To style individual tabs based on their state (:only-one, :first, :last, :middle, :previous-selected, :next-selected, :selected) you can use stylesheet-code similar to this:
QTabBar::tab {
border: 1px solid #C4C4C3;
border-bottom-color: #C2C7CB;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
padding: 1px 3px;
margin-left: 1px;
margin-bottom: 4px;
}
QTabBar::tab:selected {
background-color: #f14040;
border-bottom-style: none;
}
As the individual tabs are not widgets (or objects), they have no object name or other properties that could identify them to a stylsheet. You can only use the pseudo-classes to style tabs with a stylesheet.
You'll probably have to use (C++) code to change the style of a tab depending on the label. The recommended way for customizing styles in Qt is through the class QStyle. You can either subclass QStyle or use QProxyStyle to change the looks of specific widgets. The other alternative (probably not recommended by Qt) is though subclassing QTabBar and reimplementing the function QWidget::paintEvent( QPaintEvent *event).

Resources