summaryrefslogtreecommitdiffstats
path: root/src/styles/qcommonstyle.cpp
diff options
context:
space:
mode:
authorDarrell Anderson <humanreadable@yahoo.com>2012-11-14 15:29:51 -0600
committerDarrell Anderson <humanreadable@yahoo.com>2012-11-14 15:29:51 -0600
commit338f274c8595067bd2bee4e5ab28d097527cb557 (patch)
treef4a9aee6fda734a0357581af861e782ac87c0540 /src/styles/qcommonstyle.cpp
parent77053d90dc16bb25405d7f3b3353af4424c6e4b1 (diff)
parent367668d690ce2270f4d99f9a19ea800b6ea84a39 (diff)
downloadtqt3-338f274c8595067bd2bee4e5ab28d097527cb557.tar.gz
tqt3-338f274c8595067bd2bee4e5ab28d097527cb557.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tqt3
Diffstat (limited to 'src/styles/qcommonstyle.cpp')
-rw-r--r--src/styles/qcommonstyle.cpp732
1 files changed, 370 insertions, 362 deletions
diff --git a/src/styles/qcommonstyle.cpp b/src/styles/qcommonstyle.cpp
index a303a805d..1bc1d0373 100644
--- a/src/styles/qcommonstyle.cpp
+++ b/src/styles/qcommonstyle.cpp
@@ -251,421 +251,429 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj
}
TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* widget, const TQStyleOption& opt, bool populateReliantFields) {
+ return populateControlElementDataFromWidget(widget, opt, populateReliantFields, false);
+}
+
+TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* widget, const TQStyleOption& opt, bool populateReliantFields, bool populateMinimumNumberOfFields) {
TQStyleControlElementData ceData;
if (widget) {
ceData.widgetObjectTypes = getObjectTypeListForObject(widget);
- ceData.allDataPopulated = populateReliantFields;
- const TQPixmap* erasePixmap = widget->backgroundPixmap();
- if (erasePixmap) {
- ceData.bgPixmap = *erasePixmap;
- }
- if (populateReliantFields) {
- ceData.bgBrush = widget->backgroundBrush();
+ ceData.allDataPopulated = populateReliantFields & populateMinimumNumberOfFields;
+ if (!populateMinimumNumberOfFields) {
+ const TQPixmap* erasePixmap = widget->backgroundPixmap();
+ if (erasePixmap) {
+ ceData.bgPixmap = *erasePixmap;
+ }
+ if (populateReliantFields) {
+ ceData.bgBrush = widget->backgroundBrush();
+ ceData.windowState = (TQt::WindowState)(widget->windowState());
+ }
}
ceData.wflags = widget->getWFlags();
- if (populateReliantFields) {
- ceData.windowState = (TQt::WindowState)(widget->windowState());
- }
- ceData.bgColor = widget->eraseColor();
- ceData.bgOffset = widget->backgroundOffset();
- ceData.backgroundMode = widget->backgroundMode();
- if (populateReliantFields) {
- ceData.fgColor = widget->foregroundColor();
- ceData.colorGroup = widget->colorGroup();
- ceData.paletteBgColor = widget->paletteBackgroundColor();
- }
- ceData.geometry = widget->geometry();
- ceData.rect = widget->rect();
- ceData.pos = widget->pos();
- const TQPixmap* icon = widget->icon();
- if (icon) {
- ceData.icon = *icon;
+ if (!populateMinimumNumberOfFields) {
+ ceData.bgColor = widget->eraseColor();
+ ceData.bgOffset = widget->backgroundOffset();
+ ceData.backgroundMode = widget->backgroundMode();
+ if (populateReliantFields) {
+ ceData.fgColor = widget->foregroundColor();
+ ceData.colorGroup = widget->colorGroup();
+ ceData.paletteBgColor = widget->paletteBackgroundColor();
+ }
+ ceData.geometry = widget->geometry();
+ ceData.rect = widget->rect();
+ ceData.pos = widget->pos();
+ const TQPixmap* icon = widget->icon();
+ if (icon) {
+ ceData.icon = *icon;
+ }
+ ceData.palette = widget->palette();
+ ceData.font = widget->font();
}
- ceData.palette = widget->palette();
- ceData.font = widget->font();
ceData.name = widget->name();
ceData.caption = widget->caption();
- if (ceData.widgetObjectTypes.contains("TQPushButton")) {
- const TQPushButton *button = dynamic_cast<const TQPushButton*>(widget);
- if (button) {
- TQIconSet* iconSet = 0;
- const TQPixmap* fgPixmap = 0;
- iconSet = button->iconSet();
- fgPixmap = button->pixmap();
- if (iconSet) {
- ceData.iconSet = *iconSet;
- }
- if (fgPixmap) {
- ceData.fgPixmap = *fgPixmap;
+ if (!populateMinimumNumberOfFields) {
+ if (ceData.widgetObjectTypes.contains("TQPushButton")) {
+ const TQPushButton *button = dynamic_cast<const TQPushButton*>(widget);
+ if (button) {
+ TQIconSet* iconSet = 0;
+ const TQPixmap* fgPixmap = 0;
+ iconSet = button->iconSet();
+ fgPixmap = button->pixmap();
+ if (iconSet) {
+ ceData.iconSet = *iconSet;
+ }
+ if (fgPixmap) {
+ ceData.fgPixmap = *fgPixmap;
+ }
}
}
- }
- if (ceData.widgetObjectTypes.contains("TQToolButton")) {
- const TQToolButton *button = dynamic_cast<const TQToolButton*>(widget);
- if (button) {
- const TQPixmap* fgPixmap = 0;
- ceData.iconSet = button->iconSet();
- fgPixmap = button->pixmap();
- if (fgPixmap) {
- ceData.fgPixmap = *fgPixmap;
+ if (ceData.widgetObjectTypes.contains("TQToolButton")) {
+ const TQToolButton *button = dynamic_cast<const TQToolButton*>(widget);
+ if (button) {
+ const TQPixmap* fgPixmap = 0;
+ ceData.iconSet = button->iconSet();
+ fgPixmap = button->pixmap();
+ if (fgPixmap) {
+ ceData.fgPixmap = *fgPixmap;
+ }
+ ceData.textLabel = button->textLabel();
+ ceData.toolButtonTextPosition = button->textPosition();
+ ceData.popupDelay = button->popupDelay();
}
- ceData.textLabel = button->textLabel();
- ceData.toolButtonTextPosition = button->textPosition();
- ceData.popupDelay = button->popupDelay();
}
- }
- if (ceData.widgetObjectTypes.contains("TQCheckBox")) {
- const TQCheckBox *button = dynamic_cast<const TQCheckBox*>(widget);
- if (button) {
- const TQPixmap* fgPixmap = 0;
- fgPixmap = button->pixmap();
- if (fgPixmap) {
- ceData.fgPixmap = *fgPixmap;
+ if (ceData.widgetObjectTypes.contains("TQCheckBox")) {
+ const TQCheckBox *button = dynamic_cast<const TQCheckBox*>(widget);
+ if (button) {
+ const TQPixmap* fgPixmap = 0;
+ fgPixmap = button->pixmap();
+ if (fgPixmap) {
+ ceData.fgPixmap = *fgPixmap;
+ }
}
}
- }
- if (ceData.widgetObjectTypes.contains("TQRadioButton")) {
- const TQRadioButton *button = dynamic_cast<const TQRadioButton*>(widget);
- if (button) {
- const TQPixmap* fgPixmap = 0;
- fgPixmap = button->pixmap();
- if (fgPixmap) {
- ceData.fgPixmap = *fgPixmap;
+ if (ceData.widgetObjectTypes.contains("TQRadioButton")) {
+ const TQRadioButton *button = dynamic_cast<const TQRadioButton*>(widget);
+ if (button) {
+ const TQPixmap* fgPixmap = 0;
+ fgPixmap = button->pixmap();
+ if (fgPixmap) {
+ ceData.fgPixmap = *fgPixmap;
+ }
}
}
- }
- if (ceData.widgetObjectTypes.contains("TQButton")) {
- const TQButton *button = dynamic_cast<const TQButton*>(widget);
- if (button) {
- ceData.text = button->text();
- }
- }
- if (ceData.widgetObjectTypes.contains("TQTabBar")) {
- const TQTabBar *tb = dynamic_cast<const TQTabBar*>(widget);
- if (tb) {
- ceData.tabBarData.tabCount = tb->count();
- ceData.tabBarData.currentTabIndex = tb->currentTab();
- ceData.tabBarData.shape = tb->shape();
- ceData.tabBarData.identIndexMap.clear();
- const TQTab* currentTab;
- for (int i=0; i<tb->count(); ++i) {
- currentTab = tb->tabAt(i);
- if (currentTab) {
- ceData.tabBarData.identIndexMap[currentTab->identifier()] = tb->indexOf(currentTab->identifier());
- }
+ if (ceData.widgetObjectTypes.contains("TQButton")) {
+ const TQButton *button = dynamic_cast<const TQButton*>(widget);
+ if (button) {
+ ceData.text = button->text();
}
- const TQTabWidget *tw = dynamic_cast<const TQTabWidget*>(tb->parent());
- if (tw) {
- TQWidget *cw;
- cw = tw->cornerWidget(TQt::TopLeft);
- if(cw) {
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].widgetObjectTypes = getObjectTypeListForObject(cw);
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].geometry = cw->geometry();
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].rect = cw->rect();
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].pos = cw->pos();
- }
- cw = tw->cornerWidget(TQt::TopRight);
- if(cw) {
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].widgetObjectTypes = getObjectTypeListForObject(cw);
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].geometry = cw->geometry();
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].rect = cw->rect();
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].pos = cw->pos();
- }
- cw = tw->cornerWidget(TQt::BottomLeft);
- if(cw) {
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].widgetObjectTypes = getObjectTypeListForObject(cw);
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].geometry = cw->geometry();
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].rect = cw->rect();
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].pos = cw->pos();
+ }
+ if (ceData.widgetObjectTypes.contains("TQTabBar")) {
+ const TQTabBar *tb = dynamic_cast<const TQTabBar*>(widget);
+ if (tb) {
+ ceData.tabBarData.tabCount = tb->count();
+ ceData.tabBarData.currentTabIndex = tb->currentTab();
+ ceData.tabBarData.shape = tb->shape();
+ ceData.tabBarData.identIndexMap.clear();
+ const TQTab* currentTab;
+ for (int i=0; i<tb->count(); ++i) {
+ currentTab = tb->tabAt(i);
+ if (currentTab) {
+ ceData.tabBarData.identIndexMap[currentTab->identifier()] = tb->indexOf(currentTab->identifier());
+ }
}
- cw = tw->cornerWidget(TQt::BottomRight);
- if(cw) {
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].widgetObjectTypes = getObjectTypeListForObject(cw);
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].geometry = cw->geometry();
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].rect = cw->rect();
- ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].pos = cw->pos();
+ const TQTabWidget *tw = dynamic_cast<const TQTabWidget*>(tb->parent());
+ if (tw) {
+ TQWidget *cw;
+ cw = tw->cornerWidget(TQt::TopLeft);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].pos = cw->pos();
+ }
+ cw = tw->cornerWidget(TQt::TopRight);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].pos = cw->pos();
+ }
+ cw = tw->cornerWidget(TQt::BottomLeft);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].pos = cw->pos();
+ }
+ cw = tw->cornerWidget(TQt::BottomRight);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].pos = cw->pos();
+ }
}
}
}
- }
- if (ceData.widgetObjectTypes.contains("TQToolBox")) {
- const TQToolBox *tb = dynamic_cast<const TQToolBox*>(widget);
- if (tb) {
- const TQWidget* currentItem = tb->currentItem();
- if (currentItem) {
- ceData.activeItemPaletteBgColor = currentItem->paletteBackgroundColor();
+ if (ceData.widgetObjectTypes.contains("TQToolBox")) {
+ const TQToolBox *tb = dynamic_cast<const TQToolBox*>(widget);
+ if (tb) {
+ const TQWidget* currentItem = tb->currentItem();
+ if (currentItem) {
+ ceData.activeItemPaletteBgColor = currentItem->paletteBackgroundColor();
+ }
}
}
- }
- if (ceData.widgetObjectTypes.contains("TQProgressBar")) {
- const TQProgressBar *pb = dynamic_cast<const TQProgressBar*>(widget);
- if (pb) {
- ceData.currentStep = pb->progress();
- ceData.totalSteps = pb->totalSteps();
- ceData.progressText = pb->progressString();
- ceData.percentageVisible = pb->percentageVisible();
- ceData.orientation = pb->orientation();
+ if (ceData.widgetObjectTypes.contains("TQProgressBar")) {
+ const TQProgressBar *pb = dynamic_cast<const TQProgressBar*>(widget);
+ if (pb) {
+ ceData.currentStep = pb->progress();
+ ceData.totalSteps = pb->totalSteps();
+ ceData.progressText = pb->progressString();
+ ceData.percentageVisible = pb->percentageVisible();
+ ceData.orientation = pb->orientation();
+ }
}
- }
- if (ceData.widgetObjectTypes.contains("TQHeader")) {
- const TQHeader *header = dynamic_cast<const TQHeader*>(widget);
- if (header) {
- int section = opt.headerSection();
- TQIconSet* iconSet = 0;
- iconSet = header->iconSet(section);
- ceData.textLabel = header->label(section);
- if (iconSet) {
- ceData.iconSet = *iconSet;
+ if (ceData.widgetObjectTypes.contains("TQHeader")) {
+ const TQHeader *header = dynamic_cast<const TQHeader*>(widget);
+ if (header) {
+ int section = opt.headerSection();
+ TQIconSet* iconSet = 0;
+ iconSet = header->iconSet(section);
+ ceData.textLabel = header->label(section);
+ if (iconSet) {
+ ceData.iconSet = *iconSet;
+ }
}
}
- }
- // Complex Controls
- if (ceData.widgetObjectTypes.contains("TQScrollBar")) {
- const TQScrollBar *sb = dynamic_cast<const TQScrollBar*>(widget);
- if (sb) {
- ceData.orientation = sb->orientation();
- ceData.minSteps = sb->minValue();
- 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();
+ // Complex Controls
+ if (ceData.widgetObjectTypes.contains("TQScrollBar")) {
+ const TQScrollBar *sb = dynamic_cast<const TQScrollBar*>(widget);
+ if (sb) {
+ ceData.orientation = sb->orientation();
+ ceData.minSteps = sb->minValue();
+ 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")) {
- const TQSlider *sl = dynamic_cast<const TQSlider*>(widget);
- if (sl) {
- ceData.orientation = sl->orientation();
- ceData.minSteps = sl->minValue();
- ceData.maxSteps = sl->maxValue();
- ceData.tickMarkSetting = sl->tickmarks();
- ceData.tickInterval = sl->tickInterval();
- ceData.currentStep = sl->value();
- ceData.startStep = sl->sliderStart();
- ceData.lineStep = sl->lineStep();
- ceData.pageStep = sl->pageStep();
- if (populateReliantFields) {
- ceData.sliderRect = sl->sliderRect();
+ if (ceData.widgetObjectTypes.contains("TQSlider")) {
+ const TQSlider *sl = dynamic_cast<const TQSlider*>(widget);
+ if (sl) {
+ ceData.orientation = sl->orientation();
+ ceData.minSteps = sl->minValue();
+ ceData.maxSteps = sl->maxValue();
+ ceData.tickMarkSetting = sl->tickmarks();
+ ceData.tickInterval = sl->tickInterval();
+ ceData.currentStep = sl->value();
+ ceData.startStep = sl->sliderStart();
+ ceData.lineStep = sl->lineStep();
+ ceData.pageStep = sl->pageStep();
+ if (populateReliantFields) {
+ ceData.sliderRect = sl->sliderRect();
+ }
}
}
- }
- if (ceData.widgetObjectTypes.contains("TQDialogButtons")) {
- const TQDialogButtons *dlgbtns = dynamic_cast<const TQDialogButtons*>(widget);
- if (dlgbtns) {
- ceData.orientation = dlgbtns->orientation();
- ceData.dlgVisibleButtons = dlgbtns->visibleButtons();
- TQDialogButtons::Button btns[] = { TQDialogButtons::All, TQDialogButtons::Reject, TQDialogButtons::Accept, TQDialogButtons::Apply, TQDialogButtons::Retry, TQDialogButtons::Ignore, TQDialogButtons::Abort, TQDialogButtons::Help };
- for(unsigned int i = 0; i < (sizeof(btns)/sizeof(btns[0])); i++) {
- if (ceData.dlgVisibleButtons & btns[i]) {
- ceData.dlgVisibleSizeHints[btns[i]] = dlgbtns->sizeHint(btns[i]);
+ if (ceData.widgetObjectTypes.contains("TQDialogButtons")) {
+ const TQDialogButtons *dlgbtns = dynamic_cast<const TQDialogButtons*>(widget);
+ if (dlgbtns) {
+ ceData.orientation = dlgbtns->orientation();
+ ceData.dlgVisibleButtons = dlgbtns->visibleButtons();
+ TQDialogButtons::Button btns[] = { TQDialogButtons::All, TQDialogButtons::Reject, TQDialogButtons::Accept, TQDialogButtons::Apply, TQDialogButtons::Retry, TQDialogButtons::Ignore, TQDialogButtons::Abort, TQDialogButtons::Help };
+ for(unsigned int i = 0; i < (sizeof(btns)/sizeof(btns[0])); i++) {
+ if (ceData.dlgVisibleButtons & btns[i]) {
+ ceData.dlgVisibleSizeHints[btns[i]] = dlgbtns->sizeHint(btns[i]);
+ }
}
+
}
-
}
- }
- if (ceData.widgetObjectTypes.contains("TQTitleBar")) {
- const TQTitleBar *tb = dynamic_cast<const TQTitleBar*>(widget);
- if (tb) {
- ceData.titleBarData.hasWindow = !!(tb->window());
- if (populateReliantFields) {
- if (ceData.titleBarData.hasWindow) {
- ceData.titleBarData.windowState = (TQt::WindowState)(tb->window()->windowState());
+ if (ceData.widgetObjectTypes.contains("TQTitleBar")) {
+ const TQTitleBar *tb = dynamic_cast<const TQTitleBar*>(widget);
+ if (tb) {
+ ceData.titleBarData.hasWindow = !!(tb->window());
+ if (populateReliantFields) {
+ if (ceData.titleBarData.hasWindow) {
+ ceData.titleBarData.windowState = (TQt::WindowState)(tb->window()->windowState());
+ }
+ ceData.titleBarData.usesActiveColor = tb->usesActiveColor();
}
- ceData.titleBarData.usesActiveColor = tb->usesActiveColor();
+ ceData.titleBarData.visibleText = tb->visibleText();
}
- ceData.titleBarData.visibleText = tb->visibleText();
}
- }
- if (ceData.widgetObjectTypes.contains("TQSpinWidget")) {
- const TQSpinWidget *sw = dynamic_cast<const TQSpinWidget*>(widget);
- if (sw) {
- ceData.spinWidgetData.buttonSymbols = sw->buttonSymbols();
- ceData.spinWidgetData.upRect = sw->upRect();
- ceData.spinWidgetData.downRect = sw->downRect();
- ceData.spinWidgetData.upEnabled = sw->isUpEnabled();
- ceData.spinWidgetData.downEnabled = sw->isDownEnabled();
+ if (ceData.widgetObjectTypes.contains("TQSpinWidget")) {
+ const TQSpinWidget *sw = dynamic_cast<const TQSpinWidget*>(widget);
+ if (sw) {
+ ceData.spinWidgetData.buttonSymbols = sw->buttonSymbols();
+ ceData.spinWidgetData.upRect = sw->upRect();
+ ceData.spinWidgetData.downRect = sw->downRect();
+ ceData.spinWidgetData.upEnabled = sw->isUpEnabled();
+ ceData.spinWidgetData.downEnabled = sw->isDownEnabled();
+ }
}
- }
- if (ceData.widgetObjectTypes.contains("TQListView")) {
- const TQListView *lv = dynamic_cast<const TQListView*>(widget);
- if (lv) {
- ceData.listViewData.rootDecorated = lv->rootIsDecorated();
- ceData.listViewData.itemMargin = lv->itemMargin();
- 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;
+ if (ceData.widgetObjectTypes.contains("TQListView")) {
+ const TQListView *lv = dynamic_cast<const TQListView*>(widget);
+ if (lv) {
+ ceData.listViewData.rootDecorated = lv->rootIsDecorated();
+ ceData.listViewData.itemMargin = lv->itemMargin();
+ TQWidget* viewport = lv->viewport();
+ if (viewport) {
+ ceData.viewportData.widgetObjectTypes = getObjectTypeListForObject(viewport);
+ ceData.viewportData.allDataPopulated = populateReliantFields & populateMinimumNumberOfFields;
+ const TQPixmap* erasePixmap = viewport->backgroundPixmap();
+ if (erasePixmap) {
+ ceData.viewportData.bgPixmap = *erasePixmap;
+ }
+ if (populateReliantFields) {
+ ceData.viewportData.bgBrush = viewport->backgroundBrush();
+ }
+ if (populateReliantFields) {
+ ceData.viewportData.windowState = (TQt::WindowState)(widget->windowState());
+ }
+ ceData.viewportData.wflags = viewport->getWFlags();
+ ceData.viewportData.bgColor = viewport->eraseColor();
+ ceData.viewportData.bgOffset = viewport->backgroundOffset();
+ ceData.viewportData.backgroundMode = viewport->backgroundMode();
+ if (populateReliantFields) {
+ ceData.viewportData.fgColor = viewport->foregroundColor();
+ ceData.viewportData.colorGroup = viewport->colorGroup();
+ ceData.viewportData.paletteBgColor = viewport->paletteBackgroundColor();
+ }
+ ceData.viewportData.geometry = viewport->geometry();
+ ceData.viewportData.rect = viewport->rect();
+ ceData.viewportData.pos = viewport->pos();
+ const TQPixmap* icon = viewport->icon();
+ if (icon) {
+ ceData.viewportData.icon = *icon;
+ }
+ ceData.viewportData.palette = viewport->palette();
+ ceData.viewportData.font = viewport->font();
+ ceData.viewportData.name = viewport->name();
+ ceData.viewportData.caption = viewport->caption();
}
- if (populateReliantFields) {
- ceData.viewportData.bgBrush = viewport->backgroundBrush();
+ }
+ }
+ if (ceData.widgetObjectTypes.contains("TQComboBox")) {
+ const TQComboBox *cb = dynamic_cast<const TQComboBox*>(widget);
+ if (cb) {
+ const TQLineEdit* lineEdit = cb->lineEdit();
+ if (lineEdit) {
+ ceData.comboBoxLineEditFlags = getControlElementFlagsForObject(lineEdit, ceData.widgetObjectTypes, TQStyleOption::Default);
}
- ceData.viewportData.wflags = viewport->getWFlags();
- if (populateReliantFields) {
- ceData.viewportData.windowState = (TQt::WindowState)(widget->windowState());
+ const TQListBox* listBox = cb->listBox();
+ if (listBox) {
+ ceData.comboBoxListBoxFlags = getControlElementFlagsForObject(listBox, ceData.widgetObjectTypes, TQStyleOption::Default);
}
- ceData.viewportData.bgColor = viewport->eraseColor();
- ceData.viewportData.bgOffset = viewport->backgroundOffset();
- ceData.viewportData.backgroundMode = viewport->backgroundMode();
- if (populateReliantFields) {
- ceData.viewportData.fgColor = viewport->foregroundColor();
- ceData.viewportData.colorGroup = viewport->colorGroup();
- ceData.viewportData.paletteBgColor = viewport->paletteBackgroundColor();
+ }
+ }
+ 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 & populateMinimumNumberOfFields;
+ const TQPixmap* erasePixmap = parentWidget->backgroundPixmap();
+ if (erasePixmap) {
+ ceData.parentWidgetData.bgPixmap = *erasePixmap;
+ }
+ if (populateReliantFields) {
+ ceData.parentWidgetData.bgBrush = parentWidget->backgroundBrush();
+ }
+ if (populateReliantFields) {
+ ceData.parentWidgetData.windowState = (TQt::WindowState)(widget->windowState());
+ }
+ ceData.parentWidgetData.wflags = parentWidget->getWFlags();
+ ceData.parentWidgetData.bgColor = parentWidget->eraseColor();
+ ceData.parentWidgetData.bgOffset = parentWidget->backgroundOffset();
+ ceData.parentWidgetData.backgroundMode = parentWidget->backgroundMode();
+ if (populateReliantFields) {
+ ceData.parentWidgetData.fgColor = parentWidget->foregroundColor();
+ ceData.parentWidgetData.colorGroup = parentWidget->colorGroup();
+ ceData.parentWidgetData.paletteBgColor = parentWidget->paletteBackgroundColor();
+ }
+ ceData.parentWidgetData.geometry = parentWidget->geometry();
+ ceData.parentWidgetData.rect = parentWidget->rect();
+ ceData.parentWidgetData.pos = parentWidget->pos();
+ const TQPixmap* icon = parentWidget->icon();
+ if (icon) {
+ ceData.parentWidgetData.icon = *icon;
+ }
+ ceData.parentWidgetData.palette = parentWidget->palette();
+ ceData.parentWidgetData.font = parentWidget->font();
+ ceData.parentWidgetData.name = parentWidget->name();
+ ceData.parentWidgetData.caption = parentWidget->caption();
+
+ const TQDockWindow * dw = dynamic_cast<const TQDockWindow*>(parentWidget);
+ if (dw) {
+ if (dw->area()) {
+ ceData.dwData.hasDockArea = true;
+ ceData.dwData.areaOrientation = dw->area()->orientation();
}
- ceData.viewportData.geometry = viewport->geometry();
- ceData.viewportData.rect = viewport->rect();
- ceData.viewportData.pos = viewport->pos();
- const TQPixmap* icon = viewport->icon();
- if (icon) {
- ceData.viewportData.icon = *icon;
+ else {
+ ceData.dwData.hasDockArea = false;
}
- ceData.viewportData.palette = viewport->palette();
- ceData.viewportData.font = viewport->font();
- ceData.viewportData.name = viewport->name();
- ceData.viewportData.caption = viewport->caption();
+ ceData.dwData.closeEnabled = dw->isCloseEnabled();
}
+ const TQToolBar * toolbar = dynamic_cast<const TQToolBar*>(parentWidget);
+ if (toolbar) {
+ ceData.toolBarData.orientation = toolbar->orientation();
+ }
+ ceData.parentWidgetFlags = getControlElementFlagsForObject(parentWidget, ceData.parentWidgetData.widgetObjectTypes, TQStyleOption::Default, populateReliantFields);
}
- }
- if (ceData.widgetObjectTypes.contains("TQComboBox")) {
- const TQComboBox *cb = dynamic_cast<const TQComboBox*>(widget);
- if (cb) {
- const TQLineEdit* lineEdit = cb->lineEdit();
- if (lineEdit) {
- ceData.comboBoxLineEditFlags = getControlElementFlagsForObject(lineEdit, ceData.widgetObjectTypes, TQStyleOption::Default);
+ const TQWidget* topLevelWidget = widget->topLevelWidget();
+ if (topLevelWidget) {
+ ceData.topLevelWidgetData.widgetObjectTypes = getObjectTypeListForObject(topLevelWidget);
+ ceData.topLevelWidgetData.allDataPopulated = populateReliantFields & populateMinimumNumberOfFields;
+ const TQPixmap* erasePixmap = topLevelWidget->backgroundPixmap();
+ if (erasePixmap) {
+ ceData.topLevelWidgetData.bgPixmap = *erasePixmap;
}
- const TQListBox* listBox = cb->listBox();
- if (listBox) {
- ceData.comboBoxListBoxFlags = getControlElementFlagsForObject(listBox, ceData.widgetObjectTypes, TQStyleOption::Default);
+ if (populateReliantFields) {
+ ceData.topLevelWidgetData.bgBrush = topLevelWidget->backgroundBrush();
}
- }
- }
- 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;
- }
- if (populateReliantFields) {
- ceData.parentWidgetData.bgBrush = parentWidget->backgroundBrush();
- }
- ceData.parentWidgetData.wflags = parentWidget->getWFlags();
- if (populateReliantFields) {
- ceData.parentWidgetData.windowState = (TQt::WindowState)(widget->windowState());
- }
- ceData.parentWidgetData.bgColor = parentWidget->eraseColor();
- ceData.parentWidgetData.bgOffset = parentWidget->backgroundOffset();
- ceData.parentWidgetData.backgroundMode = parentWidget->backgroundMode();
- if (populateReliantFields) {
- ceData.parentWidgetData.fgColor = parentWidget->foregroundColor();
- ceData.parentWidgetData.colorGroup = parentWidget->colorGroup();
- ceData.parentWidgetData.paletteBgColor = parentWidget->paletteBackgroundColor();
- }
- ceData.parentWidgetData.geometry = parentWidget->geometry();
- ceData.parentWidgetData.rect = parentWidget->rect();
- ceData.parentWidgetData.pos = parentWidget->pos();
- const TQPixmap* icon = parentWidget->icon();
- if (icon) {
- ceData.parentWidgetData.icon = *icon;
- }
- ceData.parentWidgetData.palette = parentWidget->palette();
- ceData.parentWidgetData.font = parentWidget->font();
- ceData.parentWidgetData.name = parentWidget->name();
- ceData.parentWidgetData.caption = parentWidget->caption();
-
- const TQDockWindow * dw = dynamic_cast<const TQDockWindow*>(parentWidget);
- if (dw) {
- if (dw->area()) {
- ceData.dwData.hasDockArea = true;
- ceData.dwData.areaOrientation = dw->area()->orientation();
+ if (populateReliantFields) {
+ ceData.topLevelWidgetData.windowState = (TQt::WindowState)(widget->windowState());
}
- else {
- ceData.dwData.hasDockArea = false;
+ ceData.topLevelWidgetData.wflags = topLevelWidget->getWFlags();
+ ceData.topLevelWidgetData.bgColor = topLevelWidget->eraseColor();
+ ceData.topLevelWidgetData.bgOffset = topLevelWidget->backgroundOffset();
+ ceData.topLevelWidgetData.backgroundMode = topLevelWidget->backgroundMode();
+ if (populateReliantFields) {
+ ceData.topLevelWidgetData.fgColor = topLevelWidget->foregroundColor();
+ ceData.topLevelWidgetData.colorGroup = topLevelWidget->colorGroup();
+ ceData.topLevelWidgetData.paletteBgColor = topLevelWidget->paletteBackgroundColor();
}
- ceData.dwData.closeEnabled = dw->isCloseEnabled();
- }
- const TQToolBar * toolbar = dynamic_cast<const TQToolBar*>(parentWidget);
- if (toolbar) {
- ceData.toolBarData.orientation = toolbar->orientation();
- }
- ceData.parentWidgetFlags = getControlElementFlagsForObject(parentWidget, ceData.parentWidgetData.widgetObjectTypes, TQStyleOption::Default, populateReliantFields);
- }
- const TQWidget* topLevelWidget = widget->topLevelWidget();
- if (topLevelWidget) {
- ceData.topLevelWidgetData.widgetObjectTypes = getObjectTypeListForObject(topLevelWidget);
- ceData.topLevelWidgetData.allDataPopulated = populateReliantFields;
- const TQPixmap* erasePixmap = topLevelWidget->backgroundPixmap();
- if (erasePixmap) {
- ceData.topLevelWidgetData.bgPixmap = *erasePixmap;
- }
- if (populateReliantFields) {
- ceData.topLevelWidgetData.bgBrush = topLevelWidget->backgroundBrush();
- }
- ceData.topLevelWidgetData.wflags = topLevelWidget->getWFlags();
- if (populateReliantFields) {
- ceData.topLevelWidgetData.windowState = (TQt::WindowState)(widget->windowState());
- }
- ceData.topLevelWidgetData.bgColor = topLevelWidget->eraseColor();
- ceData.topLevelWidgetData.bgOffset = topLevelWidget->backgroundOffset();
- ceData.topLevelWidgetData.backgroundMode = topLevelWidget->backgroundMode();
- if (populateReliantFields) {
- ceData.topLevelWidgetData.fgColor = topLevelWidget->foregroundColor();
- ceData.topLevelWidgetData.colorGroup = topLevelWidget->colorGroup();
- ceData.topLevelWidgetData.paletteBgColor = topLevelWidget->paletteBackgroundColor();
- }
- ceData.topLevelWidgetData.geometry = topLevelWidget->geometry();
- ceData.topLevelWidgetData.rect = topLevelWidget->rect();
- ceData.topLevelWidgetData.pos = topLevelWidget->pos();
- const TQPixmap* icon = topLevelWidget->icon();
- if (icon) {
- ceData.topLevelWidgetData.icon = *icon;
- }
- ceData.topLevelWidgetData.palette = topLevelWidget->palette();
- ceData.topLevelWidgetData.font = topLevelWidget->font();
- ceData.topLevelWidgetData.name = topLevelWidget->name();
- ceData.topLevelWidgetData.caption = topLevelWidget->caption();
-
- const TQDockWindow * dw = dynamic_cast<const TQDockWindow*>(topLevelWidget);
- if (dw) {
- if (dw->area()) {
- ceData.dwData.hasDockArea = true;
- ceData.dwData.areaOrientation = dw->area()->orientation();
+ ceData.topLevelWidgetData.geometry = topLevelWidget->geometry();
+ ceData.topLevelWidgetData.rect = topLevelWidget->rect();
+ ceData.topLevelWidgetData.pos = topLevelWidget->pos();
+ const TQPixmap* icon = topLevelWidget->icon();
+ if (icon) {
+ ceData.topLevelWidgetData.icon = *icon;
}
- else {
- ceData.dwData.hasDockArea = false;
+ ceData.topLevelWidgetData.palette = topLevelWidget->palette();
+ ceData.topLevelWidgetData.font = topLevelWidget->font();
+ ceData.topLevelWidgetData.name = topLevelWidget->name();
+ ceData.topLevelWidgetData.caption = topLevelWidget->caption();
+
+ const TQDockWindow * dw = dynamic_cast<const TQDockWindow*>(topLevelWidget);
+ if (dw) {
+ if (dw->area()) {
+ ceData.dwData.hasDockArea = true;
+ ceData.dwData.areaOrientation = dw->area()->orientation();
+ }
+ else {
+ ceData.dwData.hasDockArea = false;
+ }
+ ceData.dwData.closeEnabled = dw->isCloseEnabled();
+ }
+ const TQToolBar * toolbar = dynamic_cast<const TQToolBar*>(topLevelWidget);
+ if (toolbar) {
+ ceData.toolBarData.orientation = toolbar->orientation();
}
- ceData.dwData.closeEnabled = dw->isCloseEnabled();
+ ceData.topLevelWidgetFlags = getControlElementFlagsForObject(topLevelWidget, ceData.topLevelWidgetData.widgetObjectTypes, TQStyleOption::Default, populateReliantFields);
}
- const TQToolBar * toolbar = dynamic_cast<const TQToolBar*>(topLevelWidget);
- if (toolbar) {
- ceData.toolBarData.orientation = toolbar->orientation();
+
+ TQCheckListItem *item = opt.checkListItem();
+ if (item) {
+ ceData.checkListItemData.dataValid = true;
+ ceData.checkListItemData.enabled = item->isEnabled();
+ ceData.checkListItemData.hasParent = ( item->parent() && (item->parent()->rtti() == 1) && (((TQCheckListItem*) item->parent())->type() == TQCheckListItem::Controller) );
+ ceData.checkListItemData.height = item->height();
+ }
+ else {
+ ceData.checkListItemData.dataValid = false;
}
- ceData.topLevelWidgetFlags = getControlElementFlagsForObject(topLevelWidget, ceData.topLevelWidgetData.widgetObjectTypes, TQStyleOption::Default, populateReliantFields);
- }
-
- TQCheckListItem *item = opt.checkListItem();
- if (item) {
- ceData.checkListItemData.dataValid = true;
- ceData.checkListItemData.enabled = item->isEnabled();
- ceData.checkListItemData.hasParent = ( item->parent() && (item->parent()->rtti() == 1) && (((TQCheckListItem*) item->parent())->type() == TQCheckListItem::Controller) );
- ceData.checkListItemData.height = item->height();
- }
- else {
- ceData.checkListItemData.dataValid = false;
}
}