Qt: TQtComboBox fix for call IntfGetItems when we are non-editable combobox.

git-svn-id: trunk@42905 -
This commit is contained in:
zeljko 2013-09-20 18:02:42 +00:00
parent 526b5ca7d6
commit 8d3d601588

View File

@ -9790,17 +9790,23 @@ begin
// our combo geometry // our combo geometry
R := getGeometry; R := getGeometry;
// our combo arrow position
opt := QStyleOptionComboBox_create();
QStyle_subControlRect(QApplication_style(), @R1, QStyleCC_ComboBox,
opt, QStyleSC_ComboBoxArrow, QComboBoxH(Widget));
QStyleOptionComboBox_destroy(opt);
Pt := Point(P.X, P.Y); Pt := Point(P.X, P.Y);
R := Rect(0, 0, R.Right - R.Left, R.Bottom - R.Top); // our combo arrow position when we are editable combobox
ButtonRect := Rect(R.Right + R1.Left, R.Top, if getEditable then
R.Right - R1.Right, R.Bottom); begin
opt := QStyleOptionComboBox_create();
QStyle_subControlRect(QApplication_style(), @R1, QStyleCC_ComboBox,
opt, QStyleSC_ComboBoxArrow, QComboBoxH(Widget));
QStyleOptionComboBox_destroy(opt);
R := Rect(0, 0, R.Right - R.Left, R.Bottom - R.Top);
ButtonRect := Rect(R.Right + R1.Left, R.Top,
R.Right - R1.Right, R.Bottom);
end else
begin
ButtonRect := R;
OffsetRect(ButtonRect, -R.Left, -R.Top);
end;
if PtInRect(ButtonRect, Pt) then if PtInRect(ButtonRect, Pt) then
TCustomComboBox(LCLObject).IntfGetItems; TCustomComboBox(LCLObject).IntfGetItems;