summaryrefslogtreecommitdiffstats
path: root/kexi/formeditor/formIO.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-21 14:05:41 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-21 14:05:41 -0600
commit2d6954f69caf63ed5057bd8e1405a65d7d970292 (patch)
tree88e6436b2e81d4e68313f02a9021054252e14cc4 /kexi/formeditor/formIO.cpp
parentf0de9e167e289ab7dc33e57f077c1f04ec7c68c8 (diff)
downloadkoffice-2d6954f69caf63ed5057bd8e1405a65d7d970292.tar.gz
koffice-2d6954f69caf63ed5057bd8e1405a65d7d970292.zip
Rename obsolete tq methods to standard names
Diffstat (limited to 'kexi/formeditor/formIO.cpp')
-rw-r--r--kexi/formeditor/formIO.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/kexi/formeditor/formIO.cpp b/kexi/formeditor/formIO.cpp
index 9161049d..bf3b9d08 100644
--- a/kexi/formeditor/formIO.cpp
+++ b/kexi/formeditor/formIO.cpp
@@ -66,7 +66,7 @@ void
CustomWidget::paintEvent(TQPaintEvent *)
{
TQPainter p(this);
- p.setPen(tqpalette().active().text());
+ p.setPen(palette().active().text());
TQRect r(rect());
r.setX(r.x()+2);
p.drawText(r, TQt::AlignTop, m_className);
@@ -971,7 +971,7 @@ FormIO::saveWidget(ObjectTreeItem *item, TQDomElement &parent, TQDomDocument &do
// if (-1 != item->widget()->metaObject()->findProperty("dataSource"))
// savePropertyValue(tclass, domDoc, "dataSource", item->widget()->property("dataSource"), item->widget());
- // We don't want to save the geometry if the widget is inside a tqlayout (so parent.tagName() == "grid" for example)
+ // We don't want to save the geometry if the widget is inside a layout (so parent.tagName() == "grid" for example)
if(item && !item->parent()) {
// save form widget size, but not its position
savePropertyValue(tclass, domDoc, "geometry",
@@ -999,7 +999,7 @@ FormIO::saveWidget(ObjectTreeItem *item, TQDomElement &parent, TQDomDocument &do
savedAlignment = true;
}
}
- else if(name == "name" || name == "geometry" || name == "tqlayout") {
+ else if(name == "name" || name == "geometry" || name == "layout") {
// these have already been saved
}
else {
@@ -1017,42 +1017,42 @@ FormIO::saveWidget(ObjectTreeItem *item, TQDomElement &parent, TQDomDocument &do
}
}
- // Saving container 's tqlayout if there is one
- TQDomElement tqlayout;
+ // Saving container 's layout if there is one
+ TQDomElement layout;
if(item->container() && item->container()->layoutType() != Container::NoLayout)
{
- if(item->container()->tqlayout()) // there is a tqlayout
+ if(item->container()->layout()) // there is a layout
{
- tqlayout = domDoc.createElement("temp");
- savePropertyValue(tqlayout, domDoc, "name", "unnamed", item->widget());
+ layout = domDoc.createElement("temp");
+ savePropertyValue(layout, domDoc, "name", "unnamed", item->widget());
if(item->modifiedProperties()->contains("layoutMargin"))
- savePropertyElement(tqlayout, domDoc, "property", "margin", item->container()->layoutMargin());
+ savePropertyElement(layout, domDoc, "property", "margin", item->container()->layoutMargin());
if(item->modifiedProperties()->contains("layoutSpacing"))
- savePropertyElement(tqlayout, domDoc, "property", "spacing", item->container()->layoutSpacing());
- tclass.appendChild(tqlayout);
+ savePropertyElement(layout, domDoc, "property", "spacing", item->container()->layoutSpacing());
+ tclass.appendChild(layout);
}
}
int layoutType = item->container() ? item->container()->layoutType() : Container::NoLayout;
switch(layoutType) {
- case Container::Grid: // grid tqlayout
+ case Container::Grid: // grid layout
{
- tqlayout.setTagName("grid");
+ layout.setTagName("grid");
for(ObjectTreeItem *objIt = item->children()->first(); objIt; objIt = item->children()->next())
- saveWidget(objIt, tqlayout, domDoc, true);
+ saveWidget(objIt, layout, domDoc, true);
break;
}
case Container::HBox: case Container::VBox:
{
// as we don't save geometry, we need to sort widgets in the right order, not creation order
WidgetList *list;
- if(tqlayout.tagName() == "hbox") {
+ if(layout.tagName() == "hbox") {
list = new HorWidgetList(item->container()->form()->toplevelContainer()->widget());
- tqlayout.setTagName("hbox");
+ layout.setTagName("hbox");
}
else {
list = new VerWidgetList(item->container()->form()->toplevelContainer()->widget());
- tqlayout.setTagName("vbox");
+ layout.setTagName("vbox");
}
for(ObjectTreeItem *objTree = item->children()->first(); objTree; objTree = item->children()->next())
@@ -1062,28 +1062,28 @@ FormIO::saveWidget(ObjectTreeItem *item, TQDomElement &parent, TQDomDocument &do
for(TQWidget *obj = list->first(); obj; obj = list->next()) {
ObjectTreeItem *titem = item->container()->form()->objectTree()->lookup(obj->name());
if(item)
- saveWidget(titem, tqlayout, domDoc);
+ saveWidget(titem, layout, domDoc);
}
delete list;
break;
}
case Container::HFlow: case Container::VFlow:
{
- tqlayout.setTagName("grid");
- KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->tqlayout());
+ layout.setTagName("grid");
+ KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->layout());
if(!flow) break;
WidgetList *list = (WidgetList*)flow->widgetList();
// save some special properties
- savePropertyElement(tqlayout, domDoc, "property", "customLayout", Container::layoutTypeToString(item->container()->layoutType()) );
- savePropertyElement(tqlayout, domDoc, "property", "justify", TQVariant(static_cast<KexiFlowLayout*>(item->container()->tqlayout())->isJustified(), 3) );
+ savePropertyElement(layout, domDoc, "property", "customLayout", Container::layoutTypeToString(item->container()->layoutType()) );
+ savePropertyElement(layout, domDoc, "property", "justify", TQVariant(static_cast<KexiFlowLayout*>(item->container()->layout())->isJustified(), 3) );
- // fill the widget's grid info, ie just simulate grid tqlayout
+ // fill the widget's grid info, ie just simulate grid layout
item->container()->createGridLayout(true);
for(TQWidget *obj = list->first(); obj; obj = list->next()) {
ObjectTreeItem *titem = item->container()->form()->objectTree()->lookup(obj->name());
if(item)
- saveWidget(titem, tqlayout, domDoc, true); // save grid info for compatibility with TQtDesigner
+ saveWidget(titem, layout, domDoc, true); // save grid info for compatibility with TQtDesigner
}
delete list;
break;
@@ -1153,7 +1153,7 @@ FormIO::loadWidget(Container *container, const TQDomElement &el, TQWidget *paren
else if(tagName == "vbox")
classname = "VBox";
else if(tagName == "grid") {
- // first, see if it is flow tqlayout
+ // first, see if it is flow layout
for(TQDomNode child = n.firstChild(); !child.isNull(); child = child.nextSibling()) {
if((child.toElement().tagName() == "property")
&& (child.toElement().attribute("name") == "customLayout"))
@@ -1204,7 +1204,7 @@ FormIO::loadWidget(Container *container, const TQDomElement &el, TQWidget *paren
KAcceleratorManager::setNoAccel(w);
}
#endif
- w->setStyle(&(container->widget()->tqstyle()));
+ w->setStyle(&(container->widget()->style()));
w->show();
// We create and insert the ObjectTreeItem at the good place in the ObjectTree
@@ -1232,27 +1232,27 @@ FormIO::loadWidget(Container *container, const TQDomElement &el, TQWidget *paren
m_currentItem = item;
// if we are inside a Grid, we need to insert the widget in the good cell
if(container->layoutType() == Container::Grid) {
- TQGridLayout *tqlayout = (TQGridLayout*)container->tqlayout();
+ TQGridLayout *layout = (TQGridLayout*)container->layout();
if(el.hasAttribute("rowspan")) { // widget spans multiple cells
- if(tqlayout)
- tqlayout->addMultiCellWidget(w, el.attribute("row").toInt(), el.attribute("row").toInt() + el.attribute("rowspan").toInt()-1,
+ if(layout)
+ layout->addMultiCellWidget(w, el.attribute("row").toInt(), el.attribute("row").toInt() + el.attribute("rowspan").toInt()-1,
el.attribute("column").toInt(), el.attribute("column").toInt() + el.attribute("colspan").toInt()-1);
item->setGridPos(el.attribute("row").toInt(), el.attribute("column").toInt(), el.attribute("rowspan").toInt(),
el.attribute("colspan").toInt());
}
else {
- if(tqlayout)
- tqlayout->addWidget(w, el.attribute("row").toInt(), el.attribute("column").toInt());
+ if(layout)
+ layout->addWidget(w, el.attribute("row").toInt(), el.attribute("column").toInt());
item->setGridPos(el.attribute("row").toInt(), el.attribute("column").toInt(), 0, 0);
}
}
- else if(container->tqlayout())
- container->tqlayout()->add(w);
+ else if(container->layout())
+ container->layout()->add(w);
readChildNodes(item, container, el, w);
- if(item->container() && item->container()->tqlayout())
- item->container()->tqlayout()->activate();
+ if(item->container() && item->container()->layout())
+ item->container()->layout()->activate();
// We add the autoSaveProperties in the modifProp list of the ObjectTreeItem, so that they are saved later
TQValueList<TQCString> list(container->form()->library()->autoSaveProperties(w->className()));
@@ -1337,7 +1337,7 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomEl
//if(name == "geometry")
// hasGeometryProp = true;
if( ((eltag == "grid") || (eltag == "hbox") || (eltag == "vbox")) &&
- (name == "name")) // we don't care about tqlayout names
+ (name == "name")) // we don't care about layout names
continue;
if (node.attribute("subwidget")=="true") {
@@ -1355,22 +1355,22 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomEl
if(name == "buddy")
m_buddies->insert(readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toString(), (TQLabel*)w);
else if(((eltag == "grid") || (eltag == "hbox") || (eltag == "vbox")) &&
- item->container() && item->container()->tqlayout()) {
+ item->container() && item->container()->layout()) {
// We load the margin of a Layout
if(name == "margin") {
int margin = readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toInt();
item->container()->setLayoutMargin(margin);
- item->container()->tqlayout()->setMargin(margin);
+ item->container()->layout()->setMargin(margin);
}
// We load the spacing of a Layout
else if(name == "spacing") {
int spacing = readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toInt();
item->container()->setLayoutSpacing(spacing);
- item->container()->tqlayout()->setSpacing(spacing);
+ item->container()->layout()->setSpacing(spacing);
}
else if((name == "justify")){
bool justify = readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toBool();
- KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->tqlayout());
+ KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->layout());
if(flow)
flow->setJustified(justify);
}
@@ -1419,7 +1419,7 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomEl
loadWidget(container, node, w);
}
else if(tag == "grid") {
- // first, see if it is flow tqlayout
+ // first, see if it is flow layout
TQString layoutName;
for(TQDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
if((child.toElement().tagName() == "property") && (child.toElement().attribute("name") == "customLayout")) {
@@ -1430,33 +1430,33 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomEl
if(layoutName == "HFlow") {
item->container()->m_layType = Container::HFlow;
- KexiFlowLayout *tqlayout = new KexiFlowLayout(item->widget());
- tqlayout->setOrientation(Qt::Horizontal);
- item->container()->m_layout = (TQLayout*)tqlayout;
+ KexiFlowLayout *layout = new KexiFlowLayout(item->widget());
+ layout->setOrientation(Qt::Horizontal);
+ item->container()->m_layout = (TQLayout*)layout;
}
else if(layoutName == "VFlow") {
item->container()->m_layType = Container::VFlow;
- KexiFlowLayout *tqlayout = new KexiFlowLayout(item->widget());
- tqlayout->setOrientation(Qt::Vertical);
- item->container()->m_layout = (TQLayout*)tqlayout;
+ KexiFlowLayout *layout = new KexiFlowLayout(item->widget());
+ layout->setOrientation(Qt::Vertical);
+ item->container()->m_layout = (TQLayout*)layout;
}
- else { // grid tqlayout
+ else { // grid layout
item->container()->m_layType = Container::Grid;
- TQGridLayout *tqlayout = new TQGridLayout(item->widget(), 1, 1);
- item->container()->m_layout = (TQLayout*)tqlayout;
+ TQGridLayout *layout = new TQGridLayout(item->widget(), 1, 1);
+ item->container()->m_layout = (TQLayout*)layout;
}
readChildNodes(item, container, node, w);
}
else if(tag == "vbox") {
item->container()->m_layType = Container::VBox;
- TQVBoxLayout *tqlayout = new TQVBoxLayout(item->widget());
- item->container()->m_layout = (TQLayout*)tqlayout;
+ TQVBoxLayout *layout = new TQVBoxLayout(item->widget());
+ item->container()->m_layout = (TQLayout*)layout;
readChildNodes(item, container, node, w);
}
else if(tag == "hbox") {
item->container()->m_layType = Container::HBox;
- TQHBoxLayout *tqlayout = new TQHBoxLayout(item->widget());
- item->container()->m_layout = (TQLayout*)tqlayout;
+ TQHBoxLayout *layout = new TQHBoxLayout(item->widget());
+ item->container()->m_layout = (TQLayout*)layout;
readChildNodes(item, container, node, w);
}
else {// unknown tag, we let the Factory handle it