Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7535687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:22:04+00:00 2026-05-30T06:22:04+00:00

(source: metrotek.spb.ru ) How to do it with Qt CSS help ? I have

  • 0

image
(source: metrotek.spb.ru)

How to do it with Qt CSS help ?

I have try to use

subcontrol-origin: margin;
position: absolute;

but no success.

Thank for any help

Edit

Thank you for help and final CSS for my problem is:

QSpinBox#spin {
margin-left: 20px;  /* make room for the arrows */
margin-right: 20px;  /* make room for the arrows */
width: 20px;

border: 2 solid #515151;
background-color: #434343;
}

QSpinBox#spin::up-button  {
subcontrol-origin: margin;
subcontrol-position: center left;

width: 19px;
border-width: 1px;
}

QSpinBox#spin::up-arrow  {
image: url(:/res/images/up.png);

min-width: 19px;
min-height: 14px;
max-width: 19px;
max-height: 14px;
height: 19px;
width: 14px;
}

QSpinBox#spin::up-button:pressed  {
top: 1px;
right: 1px;
}

QSpinBox#spin::down-button  {
subcontrol-origin: margin;
subcontrol-position: center right;
width: 19px;
border-width: 1px;
}

QSpinBox#spin::down-arrow  {
image: url(:/res/images/down.png);

min-width: 19px;
min-height: 14px;
max-width: 19px;
max-height: 14px;
height: 19px;
width: 14px;
}

QSpinBox#spin::down-button:pressed  {
top: 1px;
left: 1px;
}

and additional CSS like a bonus 🙂
If you like to setup position for “up,down” arrows outside the edit at the right side only:

QSpinBox#spin {
margin-right: 40px;  /* make room for the arrows */
width: 20px;

border: 2 solid #515151;
background-color: #434343;
}

QSpinBox#spin::up-button  {
subcontrol-origin: margin;
subcontrol-position: center right;
position: relative;

left: -20px;   /*   shift position back*/
width: 19px;
border-width: 1px;
}

QSpinBox#spin::down-button  {
subcontrol-origin: margin;
subcontrol-position: center right;
width: 19px;
border-width: 1px;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:22:05+00:00Added an answer on May 30, 2026 at 6:22 am

    Have you taken a look at the Qt Stylesheet guide? They have a really specific example of how to position your up and down arrows:

    here is the link

    QSpinBox {
         padding-right: 15px; /* make room for the arrows */
         border-image: url(:/images/frame.png) 4;
         border-width: 3;
     }
    
     QSpinBox::up-button {
         subcontrol-origin: border;
         subcontrol-position: top right; /* position at the top right corner */
    
         width: 16px; /* 16 + 2*1px border-width = 15px padding + 3px parent border */
         border-image: url(:/images/spinup.png) 1;
         border-width: 1px;
     }
    
     QSpinBox::down-button {
         subcontrol-origin: border;
         subcontrol-position: bottom right; /* position at bottom right corner */
    
         width: 16px;
         border-image: url(:/images/spindown.png) 1;
         border-width: 1px;
         border-top-width: 0;
     }
    

    Just adjust the subcontrol-position. And also adjust the padding for the QSpinBox to give it padding on the left as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Source:http://jpsoft.com/help/index.htm?alias.htm Aliases can use command line parameters or parameters like those in batch files.
Source RegexOptions.IgnoreCase is more expensive than I would have thought (eg, should be barely
Source: <TD> <A HREF=/home><IMG SRC=/images/home.gif></A> <IMG SRC=/images/spacer.gif> <A HREF=/search><IMG SRC=/images/search.gif></A> <IMG SRC=/images/spacer.gif> <A HREF=/help><IMG
Moving source control files to another project is easy but what is the best
My source file starts with: #include foo.h I am able to use all of
Source files are good; RPM/DEB are easy to get; apt-get/yum are convenient. But what
Source: http://asciicasts.com/episodes/16-virtual-attributes I'd like to achieve a similar setup as below, but in CakePHP
Both source and destination tables have about 40 columns. No. of rows to be
(source: blogcu.com ) Assume there is a rabbit and at position (1,1). Moreover, its
Source code at: http://jsfiddle.net/lski/4aTm5/ I have succeeded in getting the above code in Firefox,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.