QComboBox stylesheet not working on Ubuntu 16.04 LTS - qt

I used a qss file to apply a theme to my application. It is cross platform. On Windows I can see my desired stylesheet as expected. As soon as I run application on Ubuntu 16.04 LTS (with cinnamon desktop), I observed everything is fine, except combo box. Combo Box's pop up look as native ubuntu drop down. It is not showing as I expected. How to fix it
QComboBox
{
background-color:rgba(0,0,0,0);
border:1px solid rgba(255,255,255,30);
border-radius:5px;
padding-left:5px;
padding-right:5px;
min-height:40px;
}
QComboBox::drop-down
{
subcontrol-origin: padding;
subcontrol-position: top right;
border:0px;
background-color:rgba(0,0,0,0);
width:25;
border-top-right-radius:4px;
border-bottom-right-radius:4px;
}
QComboBox QAbstractItemView
{
background-color:#424B54;
border:0px;
border-radius:0px;
outline: none;
margin:0px;
padding:5px;
}
QComboBox QAbstractItemView::item
{
min-height:40px;
color:rgba(255,255,255, 200);
background-color: rgba(0, 0, 0, 100);
}
QComboBox QAbstractItemView::item:hover,QComboBox QAbstractItemView::item:selected,QComboBox QAbstractItemView::item:selected:hover
{
min-height:40px;
background-color: rgba(255,255,255, 120);
color: rgba(0,0,0);
}
/*QComboBox:on
{
background-color:rgba(146, 39, 142, 255);
}*/
QComboBox::down-arrow
{
border-image: url(:/Theme/theme/dark/general/down.png);
padding:5px;
}
QComboBox::down-arrow:on
{
top: 1px;
left: 1px;
}
NOTE
I observed QScrollBar as well taking native stylesheet

Related

A tranparent line under QTabWidget pane

I have a QTabWidget and a QTextEdit in it. There is a transparent line under the pane of QTabWidget but not the tabs
This is surely not the textedit, as its border is set to 0px in the stylesheet. The current stylesheet I use for the tabs is:
QTabWidget{
border:0px;
height:24px;
background-color:black;
}
QTabWidget::pane > QWidget {
background-color: black;
/*was trying to find whatever property to help me*/
top:0px;
border-top:0px;
border:0px;
margin: -14px -10px -10px -10px;
}
QTabWidget QTabBar{
background-color: black;
height:100%;
width:100%;
border:0px;
}
Are there any ways I can remove/hide that line?

Search Form Styling CSS

So I have styled my search form on the top banner of my blog, but when I leave the home page to another page the background image search icon disappears! Any suggestions as to why this is happening? Thanks ;-) http://demo.boxofficeboxing.co.uk
#s {
padding:8px 6px;
background:rgba(0, 0, 0, 0);
border-style: solid;
border-color: #fff;
border-width: 1px 0px 1px 1px;
font-family:open sans;
font-size:14px;
color: #fff;
}
#searchsubmit {
cursor:pointer;
position:relative;
padding:8px 16px;
left:-9px;
border-style: solid;
border-color: #fff;
border-width: 1px 1px 1px 0px;
background-color: #a88f4b;
font-family:open sans;
font-size:14px;
background-image: url('wp-content/uploads/2017/12/search.png');
background-position: center center;
background-repeat:no-repeat;
text-indent: -9999px;
}
::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: white;
}
::-moz-placeholder { /* Firefox 19+ */
color: white;
}
:-ms-input-placeholder { /* IE 10+ */
color: white;
}
:-moz-placeholder { /* Firefox 18- */
color: white;
}
input:focus {
outline: none;
}
It is simple enough to crack..
The path for your image icon is set to
wp-content/uploads/2017/12/search.png
So when on home page - the url becomes
http://demo.boxofficeboxing.co.uk/wp-content/uploads/2017/12/search.png
And when on inside page - say video highlights - the url turns to be
http://demo.boxofficeboxing.co.uk/videos-highlights/wp-content/uploads/2017/12/search.png
One way to resolve the same will be set the URL in css to be
/wp-content/uploads/2017/12/search.png
That should solve your issue / probelm.
Your reference to the image is relative, so when you go to another page, it's reference is wrong. Make your background-image URL value absolute.
The url wp-content/uploads/2017/12/search.png supplied to background-image is relative, so while it works on your homepage, if for example you navigate to the /news/ section, becomes http://demo.boxofficeboxing.co.uk/news/wp-content/uploads/2017/12/search.png instead of http://demo.boxofficeboxing.co.uk/wp-content/uploads/2017/12/search.png. Just give it an absolute url complete with http://... and it should be fine.

How change font color for QMessageBox Label's?

What I mean
QMessageBox::question, QMessageBox::warning, QMessageBox::critical, QMessageBox::Information { /* Base Text Size & Color */
font-size:12px;
color:#ffffff;
}
If I try QmessageBox .QLabel it's change font for all form/windows
end how add background if I use global setting for all
QDialog {
border-image: url(':/images/image') 0 0 0 0 stretch stretch;
}
it's set , but how set only for this QMessageBoxes.
This I understand , but hv another problem, I add to background
QMessageBox QLabel {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0.5 rgba(0, 0, 0, 102));
border:0;
border-radius:6px;
font-size:10px;
font-weight:bold;
padding-left:5px;
padding-right:5px;
padding-top:5px;
padding-bottom:5px;
but it add to icon to , how fix this ?
Have you tried:
QMessageBox {
background-color: rgb(51, 51, 51);
}
QMessageBox QLabel {
color: rgb(200, 200, 200);
}
http://doc.qt.io/qt-5/stylesheet-syntax.html
setStyleSheet("QMessageBox{background: rgb(255,0,0); border: none;font-family: Arial; font-style: normal; font-size: 15pt; color: #000000 ; }");
result
You can also set the color with tags inside the string passed as parameter to the QMessageBox:
QMessageBox::question(this, "Question", "<FONT COLOR='#ff0000'>Are you ready?</FONT>",
QMessageBox::Yes|QMessageBox::No);

How can i see or how do i know where to put the control according to the screen when using css?

I'm using netbeans 8.0.1 and i have a css file with this content:
/* null margins and padding to give good cross-browser baseline */
html,body,address,blockquote,div,
form,fieldset,caption,
h1,h2,h3,h4,h5,h6,
hr,ul,li,ol,ul,dd,dt,dl,
table,tr,td,th,p,img {
margin:0;
padding:0;
}
img,fieldset {
border:none;
}
hr {
display:none;
/*
HR in my code are for semantic breaks in topic/section, NOT
style/presenation, so hide them from screen.css users
*/
}
#media (max-width:600px) {
* {
-webkit-text-size-adjust:none;
-moz-text-size-adjust:none;
-ms-text-size-adjust:none;
}
}
body {
font:normal 85%/150% "segoe ui",helvetica,sans-serif;
}
.ss_scripted img {
display:none;
}
.ss_scripted .ss_show {
display:block;
}
#slideShow img {
margin:0 auto;
}
#slideCounter {
text-align:center;
padding:0.25em 1em;
font:bold 200%/120% consolas,courier,monospace;
color:#C00;
}
#slideControls {
width:512px;
padding:0.5em 0;
margin:0 auto;
}
#slideControls a {
float:left;
padding:0.25em 0.6em;
text-decoration:none;
color:#000;
background:#EEE;
border:2px solid #666;
-webkit-border-radius:1em;
-moz-border-radius:1em;
border-radius:1em;
-webkit-box-shadow:
inset 0 -0.5em 1em rgba(0,0,0,0.3),
0 0 1px #000;
-moz-box-shadow:
inset 0 -0.5em 1em rgba(0,0,0,0.3),
0 0 1px #000;
box-shadow:
inset 0 -0.5em 1em rgba(0,0,0,0.3),
0 0 1px #000;
}
#slideControls a:active,
#slideControls a:focus,
#slideControls a:hover {
background:#FFF;
}
#slideControls .next {
float:right;
}
How can i see in real time where it put and change the location of the controls and other stuff ?
I can change the values and run it every time to see but that's a lot of work.
For example in c# there is a designer. That's what i mean something like a designer.
You can use the Developer Tools on Chrome. Try with F12 or right click the element you want and chose "inspect element"
If I understood correctly, you can open the browser console by pressing F12.
You'll be able to spot a styles section under elements tab (inspector in FF), where you can change the CSS properties real time.
Following is a screenshot of chrome's console (It's somewhat similar is all major browses):
Right clicking and choosing inspect element will open the console in the above mentioned tab where you can play with the styles and corresponding changes real time

Autoformatting LESS code with vim

How to make vim format this LESS code properly? =G command gives horrific results.
Here is a sample:
// главный слайдер main slider
.herounit-row {
position: relative;
}
.hero-box {
position:absolute;
top:0;
width:100%;
.centered();
}
Here is how it looks after gg=G:
// главный слайдер main slider
.herounit-row {
position: relative;
}
.hero-box {
position:absolute;
top:0;
width:100%;
.centered();
}
If you want to use Vim's shipped filetypes, you can:
:set ft=scss
Afterwards gg=G should deliver the expected results.
EDIT: If it's working for all your use cases, you could also automate this via (I'm assuming the less file extension here):
autoread BufNewFile,BufRead *.less set filetype=scss
For me, this https://github.com/groenewege/vim-less worked nice.
But to be honest, I only see your padding line wrong, the rest seem ok.
This is your less code formated on my vim:
h1,h2,h3,h4,h5,h6 {
font-family: #main-font;
}
.browse-button {
.transition(0.4s all);
line-height: 2.3em;
padding: 0 13px 0 13px;
background: #additional-color;
font-size: 1em;
border:none;
color:#fff;
white-space: nowrap;
.border-radius(15px);
&:hover {
color:#dfdfdf;
background:lighten(#additional-color, 10%);
}
&:active {
box-shadow:inset 0px 1px 3px rgba(0, 0, 0, .5);
}
}

Resources