summaryrefslogtreecommitdiffstats
path: root/kexi/formeditor/editlistviewdialog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/formeditor/editlistviewdialog.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/formeditor/editlistviewdialog.cpp')
-rw-r--r--kexi/formeditor/editlistviewdialog.cpp160
1 files changed, 80 insertions, 80 deletions
diff --git a/kexi/formeditor/editlistviewdialog.cpp b/kexi/formeditor/editlistviewdialog.cpp
index 5b128ec8..020a7876 100644
--- a/kexi/formeditor/editlistviewdialog.cpp
+++ b/kexi/formeditor/editlistviewdialog.cpp
@@ -16,8 +16,8 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
-#include <qheader.h>
-#include <qlayout.h>
+#include <tqheader.h>
+#include <tqlayout.h>
#include <klistview.h>
#include <ktabwidget.h>
@@ -38,53 +38,53 @@ namespace KFormDesigner {
/// A Dialog to edit the contents of a listview /////////////////////
/////////////////////////////////////////////////////////////////////////////////
-EditListViewDialog::EditListViewDialog(QWidget *parent)
-//js(kde3.2 dependent) : KDialogBase(Tabbed, 0/* WFlags */, parent, "editlistview_dialog", true, i18n("Edit listview contents"), Ok|Cancel, Ok, false)
-: KDialogBase(Tabbed, i18n("Edit Listview Contents"), Ok|Cancel, Ok, parent, "editlistview_dialog", true /* modal */, false)
+EditListViewDialog::EditListViewDialog(TQWidget *tqparent)
+//js(kde3.2 dependent) : KDialogBase(Tabbed, 0/* WFlags */, tqparent, "editlistview_dialog", true, i18n("Edit listview contents"), Ok|Cancel, Ok, false)
+: KDialogBase(Tabbed, i18n("Edit Listview Contents"), Ok|Cancel, Ok, tqparent, "editlistview_dialog", true /* modal */, false)
{
m_column = addPage(i18n("Columns"));
m_contents = addPage(i18n("Contents"));
///////// Setup the "Contents" page /////////////////////////////
- QHBoxLayout *layout = new QHBoxLayout(m_contents, 0, 6);
+ TQHBoxLayout *tqlayout = new TQHBoxLayout(m_contents, 0, 6);
//// Setup the icon toolbar /////////////////
- QVBoxLayout *vlayout = new QVBoxLayout(layout, 3);
- QToolButton *newRow = new QToolButton(m_contents);
+ TQVBoxLayout *vtqlayout = new TQVBoxLayout(tqlayout, 3);
+ TQToolButton *newRow = new TQToolButton(m_contents);
newRow->setIconSet(BarIconSet("edit_add"));
newRow->setTextLabel(i18n("&Add Item"), true);
- vlayout->addWidget(newRow);
+ vtqlayout->addWidget(newRow);
m_buttons.insert(BNewRow, newRow);
- connect(newRow, SIGNAL(clicked()), this, SLOT(newRow()));
+ connect(newRow, TQT_SIGNAL(clicked()), this, TQT_SLOT(newRow()));
- QToolButton *newChild = new QToolButton(m_contents);
+ TQToolButton *newChild = new TQToolButton(m_contents);
newChild->setIconSet(BarIconSet("1rightarrow"));
newChild->setTextLabel(i18n("New &Subitem"), true);
- vlayout->addWidget(newChild);
+ vtqlayout->addWidget(newChild);
m_buttons.insert(BNewChild, newChild);
- connect(newChild, SIGNAL(clicked()), this, SLOT(newChildRow()));
+ connect(newChild, TQT_SIGNAL(clicked()), this, TQT_SLOT(newChildRow()));
- QToolButton *delRow = new QToolButton(m_contents);
+ TQToolButton *delRow = new TQToolButton(m_contents);
delRow->setIconSet(BarIconSet("edit_remove"));
delRow->setTextLabel(i18n("&Remove Item"), true);
- vlayout->addWidget(delRow);
+ vtqlayout->addWidget(delRow);
m_buttons.insert(BRemRow, delRow);
- connect(delRow, SIGNAL(clicked()), this, SLOT(removeRow()));
+ connect(delRow, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeRow()));
- QToolButton *rowUp = new QToolButton(m_contents);
+ TQToolButton *rowUp = new TQToolButton(m_contents);
rowUp->setIconSet(BarIconSet("1uparrow"));
rowUp->setTextLabel(i18n("Move Item &Up"), true);
- vlayout->addWidget(rowUp);
+ vtqlayout->addWidget(rowUp);
m_buttons.insert(BRowUp, rowUp);
- connect(rowUp, SIGNAL(clicked()), this, SLOT(MoveRowUp()));
+ connect(rowUp, TQT_SIGNAL(clicked()), this, TQT_SLOT(MoveRowUp()));
- QToolButton *rowDown = new QToolButton(m_contents);
+ TQToolButton *rowDown = new TQToolButton(m_contents);
rowDown->setIconSet(BarIconSet("1downarrow"));
rowDown->setTextLabel(i18n("Move Item &Down"), true);
- vlayout->addWidget(rowDown);
+ vtqlayout->addWidget(rowDown);
m_buttons.insert(BRowDown, rowDown);
- connect(rowDown, SIGNAL(clicked()), this, SLOT(MoveRowDown()));
- vlayout->addStretch();
+ connect(rowDown, TQT_SIGNAL(clicked()), this, TQT_SLOT(MoveRowDown()));
+ vtqlayout->addStretch();
//// The listview ///////////
m_listview = new KListView(m_contents, "editlistview_listview");
@@ -96,55 +96,55 @@ EditListViewDialog::EditListViewDialog(QWidget *parent)
m_listview->setDropVisualizer(true);
m_listview->setAcceptDrops(true);
m_listview->setSorting(-1);
- layout->addWidget(m_listview);
+ tqlayout->addWidget(m_listview);
m_listview->setFocus();
- connect(m_listview, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(updateButtons(QListViewItem*)));
- connect(m_listview, SIGNAL(moved(QListViewItem*, QListViewItem*, QListViewItem*)), this, SLOT(updateButtons(QListViewItem*)));
+ connect(m_listview, TQT_SIGNAL(currentChanged(TQListViewItem*)), this, TQT_SLOT(updateButtons(TQListViewItem*)));
+ connect(m_listview, TQT_SIGNAL(moved(TQListViewItem*, TQListViewItem*, TQListViewItem*)), this, TQT_SLOT(updateButtons(TQListViewItem*)));
/////////////////// Setup the columns page ////////////////
- QHBoxLayout *hbox = new QHBoxLayout(m_column, 0, 6);
+ TQHBoxLayout *hbox = new TQHBoxLayout(m_column, 0, 6);
// The "item properties" field
m_editor = new KoProperty::Editor(m_column, "editcolumn_propeditor");
- m_propSet = new KoProperty::Set(this, "columns");
+ m_propSet = new KoProperty::Set(TQT_TQOBJECT(this), "columns");
m_propSet->addProperty(new KoProperty::Property("caption", "Caption", i18n("Caption"),i18n("Caption")));
m_propSet->addProperty(new KoProperty::Property("width", 100, i18n("Width"), i18n("Width")));
- m_propSet->addProperty(new KoProperty::Property("clickable", QVariant(true, 3), i18n("Clickable"), i18n("Clickable") ));
- m_propSet->addProperty(new KoProperty::Property("resizable", QVariant(true, 3), i18n("Resizable"), i18n("Resizable") ));
- m_propSet->addProperty(new KoProperty::Property("fullwidth", QVariant(false, 3), i18n("Full Width"), i18n("Full Width") ));
+ m_propSet->addProperty(new KoProperty::Property("clickable", TQVariant(true, 3), i18n("Clickable"), i18n("Clickable") ));
+ m_propSet->addProperty(new KoProperty::Property("resizable", TQVariant(true, 3), i18n("Resizable"), i18n("Resizable") ));
+ m_propSet->addProperty(new KoProperty::Property("fullwidth", TQVariant(false, 3), i18n("Full Width"), i18n("Full Width") ));
m_editor->changeSet(m_propSet);
- connect(m_propSet, SIGNAL(propertyChanged(KoProperty::Set & KoProperty::Property&)),
- this, SLOT(changeProperty(KoProperty::Set & KoProperty::Property&)));
+ connect(m_propSet, TQT_SIGNAL(propertyChanged(KoProperty::Set & KoProperty::Property&)),
+ this, TQT_SLOT(changeProperty(KoProperty::Set & KoProperty::Property&)));
// Setup the icon toolbar //////////
- QVBoxLayout *vbox = new QVBoxLayout(hbox, 3);
- QToolButton *add = new QToolButton(m_column);
+ TQVBoxLayout *vbox = new TQVBoxLayout(hbox, 3);
+ TQToolButton *add = new TQToolButton(m_column);
add->setIconSet(BarIconSet("edit_add"));
add->setTextLabel(i18n("&Add Item"), true);
vbox->addWidget(add);
m_buttons.insert(BColAdd, add);
- connect(add, SIGNAL(clicked()), this, SLOT(newItem()));
+ connect(add, TQT_SIGNAL(clicked()), this, TQT_SLOT(newItem()));
- QToolButton *remove = new QToolButton(m_column);
+ TQToolButton *remove = new TQToolButton(m_column);
remove->setIconSet(BarIconSet("edit_remove"));
remove->setTextLabel(i18n("&Remove Item"), true);
vbox->addWidget(remove);
m_buttons.insert(BColRem, remove);
- connect(remove, SIGNAL(clicked()), this, SLOT(removeItem()));
+ connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeItem()));
- QToolButton *up = new QToolButton(m_column);
+ TQToolButton *up = new TQToolButton(m_column);
up->setIconSet(BarIconSet("1uparrow"));
up->setTextLabel(i18n("Move Item &Up"), true);
vbox->addWidget(up);
m_buttons.insert(BColUp, up);
- connect(up, SIGNAL(clicked()), this, SLOT(MoveItemUp()));
+ connect(up, TQT_SIGNAL(clicked()), this, TQT_SLOT(MoveItemUp()));
- QToolButton *down = new QToolButton(m_column);
+ TQToolButton *down = new TQToolButton(m_column);
down->setIconSet(BarIconSet("1downarrow"));
down->setTextLabel(i18n("Move Item &Down"), true);
vbox->addWidget(down);
m_buttons.insert(BColDown, down);
- connect(down, SIGNAL(clicked()), this, SLOT(MoveItemDown()));
+ connect(down, TQT_SIGNAL(clicked()), this, TQT_SLOT(MoveItemDown()));
vbox->addStretch();
// The listbox with columns name /////
@@ -152,14 +152,14 @@ EditListViewDialog::EditListViewDialog(QWidget *parent)
m_listbox->setFocus();
hbox->insertWidget(0, m_listbox);
hbox->addWidget(m_editor);
- connect(m_listbox, SIGNAL(currentChanged(QListBoxItem*)), this, SLOT(updateItemProperties(QListBoxItem*)));
+ connect(m_listbox, TQT_SIGNAL(currentChanged(TQListBoxItem*)), this, TQT_SLOT(updateItemProperties(TQListBoxItem*)));
//// Init dialog and display it ////////////////////////
- setInitialSize(QSize(500, 300), true);
+ setInitialSize(TQSize(500, 300), true);
}
int
-EditListViewDialog::exec(QListView *listview)
+EditListViewDialog::exec(TQListView *listview)
{
if(!listview)
{
@@ -176,7 +176,7 @@ EditListViewDialog::exec(QListView *listview)
m_listview->header()->setStretchEnabled(listview->header()->isStretchEnabled(i), i);
m_listview->setRenameable(i, true);
}
- QListViewItem *item = listview->firstChild();
+ TQListViewItem *item = listview->firstChild();
while(item) {
loadChildNodes(m_listview, item, 0);
item = item->nextSibling();
@@ -192,7 +192,7 @@ EditListViewDialog::exec(QListView *listview)
// and we exec the dialog
int r = KDialogBase::exec();
- if(r == QDialog::Accepted)
+ if(r == TQDialog::Accepted)
{
listview->clear();
// We copy the contents of our listview back in the listview
@@ -210,7 +210,7 @@ EditListViewDialog::exec(QListView *listview)
listview->header()->setStretchEnabled(m_listview->header()->isStretchEnabled(i), i);
}
- QListViewItem *item = m_listview->firstChild();
+ TQListViewItem *item = m_listview->firstChild();
while(item)
{
loadChildNodes(listview, item, 0);
@@ -227,8 +227,8 @@ EditListViewDialog::changeProperty(KoProperty::Set& set, KoProperty::Property& p
if(&set != m_propSet)
return;
- QString name = property.name();
- QVariant value = property.value();
+ TQString name = property.name();
+ TQVariant value = property.value();
if(name == "caption") {
m_propSet->blockSignals(true); // we need to block signals because changeItem will modify selection, and call updateItemProperties
m_listbox->changeItem(value.toString(), m_listbox->currentItem());
@@ -246,7 +246,7 @@ EditListViewDialog::changeProperty(KoProperty::Set& set, KoProperty::Property& p
}
void
-EditListViewDialog::updateItemProperties(QListBoxItem *item)
+EditListViewDialog::updateItemProperties(TQListBoxItem *item)
{
if(!item)
return;
@@ -256,9 +256,9 @@ EditListViewDialog::updateItemProperties(QListBoxItem *item)
m_propSet->blockSignals(true); // we don't want changeProperty to be called
(*m_propSet)["caption"].setValue(m_listview->columnText(id), false);
(*m_propSet)["width"].setValue(m_listview->columnWidth(id), false);
- (*m_propSet)["clickable"].setValue(QVariant(m_listview->header()->isClickEnabled(id), 4), false);
- (*m_propSet)["resizable"].setValue(QVariant(m_listview->header()->isResizeEnabled(id), 4), false);
- (*m_propSet)["fullwidth"].setValue(QVariant(m_listview->header()->isStretchEnabled(id), 4), false);
+ (*m_propSet)["clickable"].setValue(TQVariant(m_listview->header()->isClickEnabled(id), 4), false);
+ (*m_propSet)["resizable"].setValue(TQVariant(m_listview->header()->isResizeEnabled(id), 4), false);
+ (*m_propSet)["fullwidth"].setValue(TQVariant(m_listview->header()->isStretchEnabled(id), 4), false);
m_propSet->blockSignals(false);
m_editor->changeSet(m_propSet);
}
@@ -296,7 +296,7 @@ void
EditListViewDialog::MoveItemUp()
{
int current = m_listbox->currentItem();
- QString text = m_listbox->text(current);
+ TQString text = m_listbox->text(current);
m_listbox->blockSignals(true);
m_listbox->changeItem(m_listbox->text(current - 1), current);
@@ -321,7 +321,7 @@ void
EditListViewDialog::MoveItemDown()
{
int current = m_listbox->currentItem();
- QString text = m_listbox->text(current);
+ TQString text = m_listbox->text(current);
m_listbox->blockSignals(true);
m_listbox->changeItem(m_listbox->text(current+1), current);
@@ -345,7 +345,7 @@ EditListViewDialog::MoveItemDown()
/// Contents page slots ////////
void
-EditListViewDialog::updateButtons(QListViewItem *item)
+EditListViewDialog::updateButtons(TQListViewItem *item)
{
if(!item)
{
@@ -356,33 +356,33 @@ EditListViewDialog::updateButtons(QListViewItem *item)
m_buttons[BNewChild]->setEnabled(true);
m_buttons[BRemRow]->setEnabled(true);
- m_buttons[BRowUp]->setEnabled( (item->itemAbove() && (item->itemAbove()->parent() == item->parent())) );
+ m_buttons[BRowUp]->setEnabled( (item->itemAbove() && (item->itemAbove()->tqparent() == item->tqparent())) );
m_buttons[BRowDown]->setEnabled(item->nextSibling());
}
void
-EditListViewDialog::loadChildNodes(QListView *listview, QListViewItem *item, QListViewItem *parent)
+EditListViewDialog::loadChildNodes(TQListView *listview, TQListViewItem *item, TQListViewItem *tqparent)
{
- QListViewItem *newItem;
+ TQListViewItem *newItem;
if(listview->inherits("KListView"))
{
- if(parent)
- newItem = new KListViewItem(parent);
+ if(tqparent)
+ newItem = new KListViewItem(tqparent);
else
newItem = new KListViewItem(listview);
}
else
{
- if(parent)
- newItem = new QListViewItem(parent);
+ if(tqparent)
+ newItem = new TQListViewItem(tqparent);
else
- newItem = new QListViewItem(listview);
+ newItem = new TQListViewItem(listview);
}
// We need to move the item at the end, which is the expected behaviour (by default it is inserted at the beginning)
- QListViewItem *last;
- if(parent)
- last = parent->firstChild();
+ TQListViewItem *last;
+ if(tqparent)
+ last = tqparent->firstChild();
else
last = listview->firstChild();
@@ -394,7 +394,7 @@ EditListViewDialog::loadChildNodes(QListView *listview, QListViewItem *item, QLi
for(int i = 0; i < listview->columns(); i++)
newItem->setText(i, item->text(i));
- QListViewItem *child = item->firstChild();
+ TQListViewItem *child = item->firstChild();
if(child)
newItem->setOpen(true);
while(child) {
@@ -406,12 +406,12 @@ EditListViewDialog::loadChildNodes(QListView *listview, QListViewItem *item, QLi
void
EditListViewDialog::newRow()
{
- KListViewItem *parent = (KListViewItem*)m_listview->selectedItem();
- if(parent)
- parent = (KListViewItem*)parent->parent();
+ KListViewItem *tqparent = (KListViewItem*)m_listview->selectedItem();
+ if(tqparent)
+ tqparent = (KListViewItem*)tqparent->tqparent();
KListViewItem *item;
- if(parent)
- item = new KListViewItem(parent, m_listview->selectedItem());
+ if(tqparent)
+ item = new KListViewItem(tqparent, m_listview->selectedItem());
else
item = new KListViewItem(m_listview, m_listview->selectedItem());
item->setText(0, i18n("New Item"));
@@ -421,16 +421,16 @@ EditListViewDialog::newRow()
void
EditListViewDialog::newChildRow()
{
- KListViewItem *parent = (KListViewItem*)m_listview->currentItem();
+ KListViewItem *tqparent = (KListViewItem*)m_listview->currentItem();
KListViewItem *item;
- if(parent)
- item = new KListViewItem(parent);
+ if(tqparent)
+ item = new KListViewItem(tqparent);
else
item = new KListViewItem(m_listview, m_listview->currentItem());
item->setText(0, i18n("Sub Item"));
m_listview->setCurrentItem(item);
- parent->setOpen(true);
+ tqparent->setOpen(true);
}
void
@@ -442,7 +442,7 @@ EditListViewDialog::removeRow()
void
EditListViewDialog::MoveRowUp()
{
- QListViewItem *item = m_listview->currentItem()->itemAbove();
+ TQListViewItem *item = m_listview->currentItem()->itemAbove();
item->moveItem(m_listview->currentItem());
updateButtons(m_listview->currentItem());
}
@@ -450,7 +450,7 @@ EditListViewDialog::MoveRowUp()
void
EditListViewDialog::MoveRowDown()
{
- QListViewItem *before = m_listview->currentItem();
+ TQListViewItem *before = m_listview->currentItem();
before->moveItem(before->nextSibling());
updateButtons(before);
}