2016-06-06 74 views
1

您好,我在QT中的组合框有问题。 我已经搜索了一段时间,但我找不到任何信息。Qt QCombobox更改滚动箭头

我必须建立一个组合框中选择一些数据 http://fs5.directupload.net/images/160606/2ekorosf.png

enter image description here

向上和向下在列表的末尾箭方式过于狭窄。
我想让它们变大。
有没有办法改变这种情况?

与正常的滚动条寄托都与我的CSS文件 正常工作,例如:

QScrollBar:vertikal {with: 50px;} 

但我无法弄清楚如何改变小箭头的图片。

回答

0

您可以使用自定义QComboBox”箭:

QComboBox::up-arrow { 
    width: Npx; 
    height: Npx; 
} 

QComboBox::down-arrow { 
    width: Npx; 
    height: Npx; 
} 

// Where "N" is the width and height you want to set. 

看看这个链接,如果你想看看如何自定义QComboBox:http://doc.qt.io/qt-5/stylesheet-examples.html

1

这不起作用。 我注意到我的问题不是机智的CamboBox。这PROGRAMM使用

QComboBox QAbstractItemView中

看来,我需要改变autoScrollMargin(或setAutoScrollMargin)以某种方式 http://doc.qt.io/qt-4.8/qabstractitemview.html#autoScrollMargin-prop 但我无法弄清楚热做到在一个CSS文件, SRY我我在Qt的非常新^^

-

我想通一些东西,如果我使用

QComboBox QAbstractItemView { 
margin-top: 50px; 
padding-bottom: 50px; 
} 

我有这样的事情 QComboBox QAbstractItemView margin

这几乎是我所期待的。 我会让你保持最新的。^^