summaryrefslogtreecommitdiffstats
path: root/src/styles/qcommonstyle.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-08-07 01:32:24 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-08-07 01:32:24 -0500
commit74dac1c21d3ad1f446874fd29f7e670e77a196b5 (patch)
tree8ff20c2c06d337cdcec36a32afc8bfd9f4120064 /src/styles/qcommonstyle.cpp
parentc73edd8f63289c619c20a8e5d031a24d870c62ee (diff)
downloadtqt3-74dac1c21d3ad1f446874fd29f7e670e77a196b5.tar.gz
tqt3-74dac1c21d3ad1f446874fd29f7e670e77a196b5.zip
Automated update from Qt3
Diffstat (limited to 'src/styles/qcommonstyle.cpp')
-rw-r--r--src/styles/qcommonstyle.cpp47
1 files changed, 35 insertions, 12 deletions
diff --git a/src/styles/qcommonstyle.cpp b/src/styles/qcommonstyle.cpp
index 45b1ba857..20c6c9993 100644
--- a/src/styles/qcommonstyle.cpp
+++ b/src/styles/qcommonstyle.cpp
@@ -156,7 +156,7 @@ TQStringList getObjectTypeListForObject(const TQObject* object) {
return objectTypes;
}
-TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* object, TQStringList objectTypeList, const TQStyleOption& opt) {
+TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* object, TQStringList objectTypeList, const TQStyleOption& opt, bool populateReliantFields) {
TQStyle::ControlElementFlags cef = (TQStyle::ControlElementFlags)0;
if (object) {
@@ -226,6 +226,11 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj
if (widget->parentWidget()) cef = cef | TQStyle::CEF_HasParentWidget;
if (widget->focusProxy()) cef = cef | TQStyle::CEF_HasFocusProxy;
if (widget->hasFocus()) cef = cef | TQStyle::CEF_HasFocus;
+ if (populateReliantFields) {
+ if (widget->isActiveWindow()) cef = cef | TQStyle::CEF_IsActiveWindow;
+ if (widget->isTopLevel()) cef = cef | TQStyle::CEF_IsTopLevel;
+ if (widget->isVisible()) cef = cef | TQStyle::CEF_IsVisible;
+ }
}
}
else {
@@ -240,6 +245,7 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
if (widget) {
ceData.widgetObjectTypes = getObjectTypeListForObject(widget);
+ ceData.allDataPopulated = populateReliantFields;
const TQPixmap* erasePixmap = widget->backgroundPixmap();
if (erasePixmap) {
ceData.bgPixmap = *erasePixmap;
@@ -373,8 +379,11 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData.maxSteps = sb->maxValue();
ceData.currentStep = sb->value();
ceData.startStep = sb->sliderStart();
+ ceData.lineStep = sb->lineStep();
ceData.pageStep = sb->pageStep();
-
+ if (populateReliantFields) {
+ ceData.sliderRect = sb->sliderRect();
+ }
}
}
if (ceData.widgetObjectTypes.contains("TQSlider")) {
@@ -387,6 +396,9 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData.startStep = sl->sliderStart();
ceData.lineStep = sl->lineStep();
ceData.pageStep = sl->pageStep();
+ if (populateReliantFields) {
+ ceData.sliderRect = sl->sliderRect();
+ }
}
}
if (ceData.widgetObjectTypes.contains("TQDialogButtons")) {
@@ -434,6 +446,7 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
TQWidget* viewport = lv->viewport();
if (viewport) {
ceData.viewportData.widgetObjectTypes = getObjectTypeListForObject(viewport);
+ ceData.viewportData.allDataPopulated = populateReliantFields;
const TQPixmap* erasePixmap = viewport->backgroundPixmap();
if (erasePixmap) {
ceData.viewportData.bgPixmap = *erasePixmap;
@@ -470,10 +483,17 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
}
}
}
+ if (ceData.widgetObjectTypes.contains("TQFrame")) {
+ const TQFrame *frame = dynamic_cast<const TQFrame*>(widget);
+ if (frame) {
+ ceData.frameStyle = frame->frameStyle();
+ }
+ }
const TQWidget* parentWidget = widget->parentWidget();
if (parentWidget) {
ceData.parentWidgetData.widgetObjectTypes = getObjectTypeListForObject(parentWidget);
+ ceData.parentWidgetData.allDataPopulated = populateReliantFields;
const TQPixmap* erasePixmap = parentWidget->backgroundPixmap();
if (erasePixmap) {
ceData.parentWidgetData.bgPixmap = *erasePixmap;
@@ -1111,7 +1131,7 @@ void TQCommonStyle::drawControl( ControlElement element,
}
int tf=AlignVCenter | ShowPrefix;
- if (!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget))
+ if ((!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget)) || ((styleHint(SH_HideUnderlineAcceleratorWhenAltUp, ceData, elementFlags, TQStyleOption::Default, 0, widget)) && (!acceleratorsShown())))
tf |= NoAccel;
#ifndef QT_NO_ICONSET
@@ -1164,7 +1184,7 @@ void TQCommonStyle::drawControl( ControlElement element,
{
#ifndef QT_NO_CHECKBOX
int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft;
- if (!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget))
+ if ((!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget)) || ((styleHint(SH_HideUnderlineAcceleratorWhenAltUp, ceData, elementFlags, TQStyleOption::Default, 0, widget)) && (!acceleratorsShown())))
alignment |= NoAccel;
drawItem(p, r, alignment | AlignVCenter | ShowPrefix, cg,
@@ -1186,7 +1206,7 @@ void TQCommonStyle::drawControl( ControlElement element,
{
#ifndef QT_NO_RADIOBUTTON
int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft;
- if (!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget))
+ if ((!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget)) || ((styleHint(SH_HideUnderlineAcceleratorWhenAltUp, ceData, elementFlags, TQStyleOption::Default, 0, widget)) && (!acceleratorsShown())))
alignment |= NoAccel;
drawItem(p, r, alignment | AlignVCenter | ShowPrefix, cg,
flags & Style_Enabled, (ceData.fgPixmap.isNull())?NULL:&ceData.fgPixmap, ceData.text);
@@ -1253,7 +1273,7 @@ void TQCommonStyle::drawControl( ControlElement element,
pixelMetric( TQStyle::PM_DefaultFrameWidth, ceData, elementFlags, widget ) );
int alignment = AlignCenter | ShowPrefix;
- if (!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget))
+ if ((!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget)) || ((styleHint(SH_HideUnderlineAcceleratorWhenAltUp, ceData, elementFlags, TQStyleOption::Default, 0, widget)) && (!acceleratorsShown())))
alignment |= NoAccel;
drawItem( p, tr, alignment, cg,
flags & Style_Enabled, 0, t->text() );
@@ -1386,7 +1406,7 @@ void TQCommonStyle::drawControl( ControlElement element,
TQMenuItem *mi = opt.menuItem();
int alignment = AlignCenter|ShowPrefix|DontClip|SingleLine;
- if (!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget))
+ if ((!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget)) || ((styleHint(SH_HideUnderlineAcceleratorWhenAltUp, ceData, elementFlags, TQStyleOption::Default, 0, widget)) && (!acceleratorsShown())))
alignment |= NoAccel;
drawItem( p, r, alignment, cg,
flags & Style_Enabled, mi->pixmap(), mi->text(), -1,
@@ -1428,7 +1448,7 @@ void TQCommonStyle::drawControl( ControlElement element,
! ceData.text.isNull() &&
! (elementFlags & CEF_UsesTextLabel)) {
int alignment = AlignCenter | ShowPrefix;
- if (!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget))
+ if ((!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget)) || ((styleHint(SH_HideUnderlineAcceleratorWhenAltUp, ceData, elementFlags, TQStyleOption::Default, 0, widget)) && (!acceleratorsShown())))
alignment |= NoAccel;
rect.moveBy(shiftX, shiftY);
@@ -1455,7 +1475,7 @@ void TQCommonStyle::drawControl( ControlElement element,
p->setFont( ceData.font );
TQRect pr = rect, tr = rect;
int alignment = ShowPrefix;
- if (!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget))
+ if ((!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget)) || ((styleHint(SH_HideUnderlineAcceleratorWhenAltUp, ceData, elementFlags, TQStyleOption::Default, 0, widget)) && (!acceleratorsShown())))
alignment |= NoAccel;
if ( ceData.toolButtonTextPosition == TQToolButton::Under ) {
@@ -2379,7 +2399,7 @@ TQRect TQCommonStyle::querySubControlMetrics( ComplexControl control,
}
#endif
- TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
+ TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption(), false);
return querySubControlMetrics(control, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), sc, opt, widget);
}
@@ -3126,7 +3146,7 @@ TQSize TQCommonStyle::sizeFromContents(ContentsType contents,
int TQCommonStyle::styleHint(StyleHint sh, const TQWidget * w, const TQStyleOption &so, TQStyleHintReturn *shr) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(w, TQStyleOption(), false);
- return styleHint(sh, ceData, getControlElementFlagsForObject(w, ceData.widgetObjectTypes, TQStyleOption()), so, shr, w);
+ return styleHint(sh, ceData, getControlElementFlagsForObject(w, ceData.widgetObjectTypes, TQStyleOption(), false), so, shr, w);
}
/*! \reimp */
@@ -3200,6 +3220,10 @@ int TQCommonStyle::styleHint(StyleHint sh, TQStyleControlElementData ceData, Con
ret = 1;
break;
+ case SH_HideUnderlineAcceleratorWhenAltUp:
+ ret = 0;
+ break;
+
default:
ret = 0;
break;
@@ -3221,5 +3245,4 @@ TQPixmap TQCommonStyle::stylePixmap(StylePixmap, TQStyleControlElementData, Cont
return TQPixmap();
}
-
#endif // QT_NO_STYLE