diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
commit | 2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch) | |
tree | 18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/entryeditdialog.cpp | |
parent | 1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff) | |
download | tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip |
TQt4 port tellico
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/entryeditdialog.cpp')
-rw-r--r-- | src/entryeditdialog.cpp | 208 |
1 files changed, 104 insertions, 104 deletions
diff --git a/src/entryeditdialog.cpp b/src/entryeditdialog.cpp index db99d7f..bccfef7 100644 --- a/src/entryeditdialog.cpp +++ b/src/entryeditdialog.cpp @@ -30,15 +30,15 @@ #include <kpushbutton.h> #include <kaccel.h> -#include <qlayout.h> -#include <qstringlist.h> -#include <qpushbutton.h> -#include <qvaluevector.h> -#include <qvbox.h> -#include <qobjectlist.h> -#include <qtabbar.h> -#include <qstyle.h> -#include <qapplication.h> +#include <tqlayout.h> +#include <tqstringlist.h> +#include <tqpushbutton.h> +#include <tqvaluevector.h> +#include <tqvbox.h> +#include <tqobjectlist.h> +#include <tqtabbar.h> +#include <tqstyle.h> +#include <tqapplication.h> namespace { // must be an even number @@ -47,8 +47,8 @@ namespace { using Tellico::EntryEditDialog; -EntryEditDialog::EntryEditDialog(QWidget* parent_, const char* name_) - : KDialogBase(parent_, name_, false, i18n("Edit Entry"), Help|User1|User2|User3|Apply|Close, User1, false, +EntryEditDialog::EntryEditDialog(TQWidget* tqparent_, const char* name_) + : KDialogBase(tqparent_, name_, false, i18n("Edit Entry"), Help|User1|User2|User3|Apply|Close, User1, false, KGuiItem(i18n("&New Entry"))), m_currColl(0), m_tabs(new GUI::TabControl(this)), @@ -67,18 +67,18 @@ EntryEditDialog::EntryEditDialog(QWidget* parent_, const char* name_) setButtonGuiItem(m_saveBtn, save); enableButton(m_saveBtn, false); - connect(this, SIGNAL(applyClicked()), SLOT(slotHandleSave())); - connect(this, SIGNAL(user1Clicked()), SLOT(slotHandleNew())); - connect(this, SIGNAL(user2Clicked()), SLOT(slotGoNextEntry())); - connect(this, SIGNAL(user3Clicked()), SLOT(slotGoPrevEntry())); + connect(this, TQT_SIGNAL(applyClicked()), TQT_SLOT(slotHandleSave())); + connect(this, TQT_SIGNAL(user1Clicked()), TQT_SLOT(slotHandleNew())); + connect(this, TQT_SIGNAL(user2Clicked()), TQT_SLOT(slotGoNextEntry())); + connect(this, TQT_SIGNAL(user3Clicked()), TQT_SLOT(slotGoPrevEntry())); KGuiItem prev; - prev.setIconName(QString::fromLatin1(QApplication::reverseLayout() ? "forward" : "back")); + prev.setIconName(TQString::tqfromLatin1(TQApplication::reverseLayout() ? "forward" : "back")); prev.setToolTip(i18n("Go to the previous entry in the collection")); prev.setWhatsThis(prev.toolTip()); KGuiItem next; - next.setIconName(QString::fromLatin1(QApplication::reverseLayout() ? "back" : "forward")); + next.setIconName(TQString::tqfromLatin1(TQApplication::reverseLayout() ? "back" : "forward")); next.setToolTip(i18n("Go to the next entry in the collection")); next.setWhatsThis(next.toolTip()); @@ -86,14 +86,14 @@ EntryEditDialog::EntryEditDialog(QWidget* parent_, const char* name_) setButtonGuiItem(m_prevBtn, prev); KAccel* accel = new KAccel(this); - accel->insert(QString::fromLatin1("Go Prev"), QString(), prev.toolTip(), Qt::Key_PageUp, - Controller::self(), SLOT(slotGoPrevEntry())); - accel->insert(QString::fromLatin1("Go Next"), QString(), next.toolTip(), Qt::Key_PageDown, - Controller::self(), SLOT(slotGoNextEntry())); + accel->insert(TQString::tqfromLatin1("Go Prev"), TQString(), prev.toolTip(), TQt::Key_PageUp, + Controller::self(), TQT_SLOT(slotGoPrevEntry())); + accel->insert(TQString::tqfromLatin1("Go Next"), TQString(), next.toolTip(), TQt::Key_PageDown, + Controller::self(), TQT_SLOT(slotGoNextEntry())); - setHelp(QString::fromLatin1("entry-editor")); + setHelp(TQString::tqfromLatin1("entry-editor")); - resize(configDialogSize(QString::fromLatin1("Edit Dialog Options"))); + resize(configDialogSize(TQString::tqfromLatin1("Edit Dialog Options"))); } void EntryEditDialog::slotClose() { @@ -142,31 +142,31 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { m_currColl = coll_; int maxHeight = 0; - QPtrList<QWidget> gridList; + TQPtrList<TQWidget> gridList; bool noChoices = true; bool focusedFirst = false; - QStringList catList = m_currColl->fieldCategories(); - for(QStringList::ConstIterator catIt = catList.begin(); catIt != catList.end(); ++catIt) { + TQStringList catList = m_currColl->fieldCategories(); + for(TQStringList::ConstIterator catIt = catList.begin(); catIt != catList.end(); ++catIt) { Data::FieldVec fields = m_currColl->fieldsByCategory(*catIt); if(fields.isEmpty()) { // sanity check continue; } - // if this layout model is changed, be sure to check slotUpdateField() - QWidget* page = new QWidget(m_tabs); - // (parent, margin, spacing) - QVBoxLayout* boxLayout = new QVBoxLayout(page, 0, 0); + // if this tqlayout model is changed, be sure to check slotUpdateField() + TQWidget* page = new TQWidget(m_tabs); + // (tqparent, margin, spacing) + TQVBoxLayout* boxLayout = new TQVBoxLayout(page, 0, 0); - QWidget* grid = new QWidget(page); + TQWidget* grid = new TQWidget(page); gridList.append(grid); - // (parent, nrows, ncols, margin, spacing) + // (tqparent, nrows, ncols, margin, spacing) // spacing gets a bit weird, if there are absolutely no Choice fields, // then spacing should be 5, which is set later - QGridLayout* layout = new QGridLayout(grid, 0, NCOLS, 8, 2); + TQGridLayout* tqlayout = new TQGridLayout(grid, 0, NCOLS, 8, 2); // keramik styles make big widget, cut down the spacing a bit - if(QCString(style().name()).lower().find("keramik", 0, false) > -1) { - layout->setSpacing(0); + if(TQCString(tqstyle().name()).lower().tqfind("keramik", 0, false) > -1) { + tqlayout->setSpacing(0); } boxLayout->addWidget(grid, 0); @@ -176,8 +176,8 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { } // keep track of which should expand - QValueVector<bool> expands(NCOLS, false); - QValueVector<int> maxWidth(NCOLS, 0); + TQValueVector<bool> expands(NCOLS, false); + TQValueVector<int> maxWidth(NCOLS, 0); Data::FieldVec::Iterator it = fields.begin(); // needed later for(int count = 0; it != fields.end(); ++it) { @@ -194,7 +194,7 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { if(!widget) { continue; } - connect(widget, SIGNAL(modified()), SLOT(slotSetModified())); + connect(widget, TQT_SIGNAL(modified()), TQT_SLOT(slotSetModified())); if(!focusedFirst && widget->isFocusEnabled()) { widget->setFocus(); focusedFirst = true; @@ -202,18 +202,18 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { int r = count/NCOLS; int c = count%NCOLS; - layout->addWidget(widget, r, c); - layout->setRowStretch(r, 1); + tqlayout->addWidget(widget, r, c); + tqlayout->setRowStretch(r, 1); - m_widgetDict.insert(QString::number(m_currColl->id()) + field->name(), widget); + m_widgetDict.insert(TQString::number(m_currColl->id()) + field->name(), widget); - maxWidth[count%NCOLS] = QMAX(maxWidth[count%NCOLS], widget->labelWidth()); + maxWidth[count%NCOLS] = TQMAX(maxWidth[count%NCOLS], widget->labelWidth()); if(widget->expands()) { expands[count%NCOLS] = true; } widget->updateGeometry(); if(!field->isSingleCategory()) { - maxHeight = QMAX(maxHeight, widget->minimumSizeHint().height()); + maxHeight = TQMAX(maxHeight, widget->tqminimumSizeHint().height()); } ++count; } @@ -221,7 +221,7 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { // now, the labels in a column should all be the same width it = fields.begin(); for(int count = 0; it != fields.end(); ++it) { - GUI::FieldWidget* widget = m_widgetDict.find(QString::number(m_currColl->id()) + it->name()); + GUI::FieldWidget* widget = m_widgetDict.tqfind(TQString::number(m_currColl->id()) + it->name()); if(widget) { widget->setLabelWidth(maxWidth[count%NCOLS]); ++count; @@ -231,7 +231,7 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { // update stretch factors for columns with a line edit for(int col = 0; col < NCOLS; ++col) { if(expands[col]) { - layout->setColStretch(col, 1); + tqlayout->setColStretch(col, 1); } } @@ -239,28 +239,28 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) { } // Now, go through and set all the field widgets to the same height - for(QPtrListIterator<QWidget> it(gridList); it.current(); ++it) { - QGridLayout* l = static_cast<QGridLayout*>(it.current()->layout()); + for(TQPtrListIterator<TQWidget> it(gridList); it.current(); ++it) { + TQGridLayout* l = static_cast<TQGridLayout*>(it.current()->tqlayout()); if(noChoices) { l->setSpacing(5); } - for(int row = 0; row < l->numRows() && it.current()->children()->count() > 1; ++row) { + for(int row = 0; row < l->numRows() && it.current()->childrenListObject().count() > 1; ++row) { l->addRowSpacing(row, maxHeight); } // I don't want anything to be hidden, Keramik has a bug if I don't do this - it.current()->setMinimumHeight(it.current()->sizeHint().height()); - // the parent of the grid is the page that got added to the tabs - it.current()->parentWidget()->layout()->invalidate(); - it.current()->parentWidget()->setMinimumHeight(it.current()->parentWidget()->sizeHint().height()); + it.current()->setMinimumHeight(it.current()->tqsizeHint().height()); + // the tqparent of the grid is the page that got added to the tabs + it.current()->tqparentWidget()->tqlayout()->tqinvalidate(); + it.current()->tqparentWidget()->setMinimumHeight(it.current()->tqparentWidget()->tqsizeHint().height()); } setUpdatesEnabled(true); // this doesn't seem to work -// setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); +// tqsetSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum); // so do this instead - layout()->invalidate(); // needed so the sizeHint() gets recalculated - m_tabs->setMinimumHeight(m_tabs->minimumSizeHint().height()); - m_tabs->setMinimumWidth(m_tabs->sizeHint().width()); + tqlayout()->tqinvalidate(); // needed so the tqsizeHint() gets recalculated + m_tabs->setMinimumHeight(m_tabs->tqminimumSizeHint().height()); + m_tabs->setMinimumWidth(m_tabs->tqsizeHint().width()); // update keyboard accels // only want to manage tabBar() @@ -308,12 +308,12 @@ void EntryEditDialog::slotHandleSave() { // add a message box if multiple items are selected if(m_currEntries.count() > 1) { - QStringList names; + TQStringList names; for(Data::EntryVec::ConstIterator entry = m_currEntries.constBegin(); entry != m_currEntries.constEnd(); ++entry) { names += entry->title(); } - QString str(i18n("Do you really want to modify these entries?")); - QString dontAsk = QString::fromLatin1("SaveMultipleBooks"); // don't change 'books', invisible anyway + TQString str(i18n("Do you really want to modify these entries?")); + TQString dontAsk = TQString::tqfromLatin1("SaveMultipleBooks"); // don't change 'books', invisible anyway int ret = KMessageBox::questionYesNoList(this, str, names, i18n("Modify Multiple Entries"), KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk); if(ret != KMessageBox::Yes) { @@ -335,17 +335,17 @@ void EntryEditDialog::slotHandleSave() { oldEntries.append(new Data::Entry(*entry)); } for(Data::FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) { - QString key = QString::number(m_currColl->id()) + fIt->name(); - GUI::FieldWidget* widget = m_widgetDict.find(key); + TQString key = TQString::number(m_currColl->id()) + fIt->name(); + GUI::FieldWidget* widget = m_widgetDict.tqfind(key); if(widget && widget->isEnabled()) { - QString temp = widget->text(); + TQString temp = widget->text(); // ok to set field empty string, just not all of them if(modified == false && entry->field(fIt) != temp) { modified = true; } entry->setField(fIt, temp); if(temp.isEmpty()) { - QString prop = fIt->property(QString::fromLatin1("required")).lower(); + TQString prop = fIt->property(TQString::tqfromLatin1("required")).lower(); if(prop == Latin1Literal("1") || prop == Latin1Literal("true")) { fieldsRequiringValues.append(fIt.data()); } @@ -355,13 +355,13 @@ void EntryEditDialog::slotHandleSave() { } if(!fieldsRequiringValues.isEmpty()) { - GUI::CursorSaver cs2(Qt::arrowCursor); - QString str = i18n("A value is required for the following fields. Do you want to continue?"); - QStringList titles; + GUI::CursorSaver cs2(TQt::arrowCursor); + TQString str = i18n("A value is required for the following fields. Do you want to continue?"); + TQStringList titles; for(Data::FieldVecIt it = fieldsRequiringValues.begin(); it != fieldsRequiringValues.end(); ++it) { titles << it->title(); } - QString dontAsk = QString::fromLatin1("SaveWithoutRequired"); + TQString dontAsk = TQString::tqfromLatin1("SaveWithoutRequired"); int ret = KMessageBox::questionYesNoList(this, str, titles, i18n("Modify Entries"), KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk); if(ret != KMessageBox::Yes) { @@ -379,7 +379,7 @@ void EntryEditDialog::slotHandleSave() { Kernel::self()->modifyEntries(oldEntries, m_currEntries); } if(!m_currEntries.isEmpty() && !m_currEntries[0]->title().isEmpty()) { - setCaption(i18n("Edit Entry") + QString::fromLatin1(" - ") + m_currEntries[0]->title()); + setCaption(i18n("Edit Entry") + TQString::tqfromLatin1(" - ") + m_currEntries[0]->title()); } } @@ -397,7 +397,7 @@ void EntryEditDialog::clear() { m_isWorking = true; // clear the widgets - for(QDictIterator<GUI::FieldWidget> it(m_widgetDict); it.current(); ++it) { + for(TQDictIterator<GUI::FieldWidget> it(m_widgetDict); it.current(); ++it) { it.current()->setEnabled(true); it.current()->clear(); it.current()->insertDefault(); @@ -462,14 +462,14 @@ void EntryEditDialog::setContents(Data::EntryVec entries_) { Data::EntryVec::ConstIterator entry; Data::FieldVec fields = m_currColl->fields(); for(Data::FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) { - QString key = QString::number(m_currColl->id()) + fIt->name(); - GUI::FieldWidget* widget = m_widgetDict.find(key); + TQString key = TQString::number(m_currColl->id()) + fIt->name(); + GUI::FieldWidget* widget = m_widgetDict.tqfind(key); if(!widget) { // probably read-only continue; } widget->editMultiple(true); - QString value = entries_[0]->field(fIt); + TQString value = entries_[0]->field(fIt); entry = entries_.constBegin(); for(++entry; entry != entries_.constEnd(); ++entry) { // skip checking the first one if(entry->field(fIt) != value) { @@ -509,7 +509,7 @@ void EntryEditDialog::setContents(Data::EntryPtr entry_) { m_currEntries.append(entry_); if(!entry_->title().isEmpty()) { - setCaption(i18n("Edit Entry") + QString::fromLatin1(" - ") + entry_->title()); + setCaption(i18n("Edit Entry") + TQString::tqfromLatin1(" - ") + entry_->title()); } if(m_currColl != entry_->collection()) { @@ -523,8 +523,8 @@ void EntryEditDialog::setContents(Data::EntryPtr entry_) { Data::FieldVec fields = m_currColl->fields(); for(Data::FieldVec::Iterator field = fields.begin(); field != fields.end(); ++field) { - QString key = QString::number(m_currColl->id()) + field->name(); - GUI::FieldWidget* widget = m_widgetDict.find(key); + TQString key = TQString::number(m_currColl->id()) + field->name(); + GUI::FieldWidget* widget = m_widgetDict.tqfind(key); if(!widget) { // is probably read-only continue; } @@ -551,36 +551,36 @@ void EntryEditDialog::removeField(Data::CollPtr, Data::FieldPtr field_) { } // myDebug() << "EntryEditDialog::removeField - name = " << field_->name() << endl; - QString key = QString::number(m_currColl->id()) + field_->name(); - GUI::FieldWidget* widget = m_widgetDict.find(key); + TQString key = TQString::number(m_currColl->id()) + field_->name(); + GUI::FieldWidget* widget = m_widgetDict.tqfind(key); if(widget) { m_widgetDict.remove(key); // if this is the last field in the category, need to remove the tab page // this function is called after the field has been removed from the collection, // so the category should be gone from the category list - if(m_currColl->fieldCategories().findIndex(field_->category()) == -1) { + if(m_currColl->fieldCategories().tqfindIndex(field_->category()) == -1) { // myDebug() << "last field in the category" << endl; - // fragile, widget's parent is the grid, whose parent is the tab page - QWidget* w = widget->parentWidget()->parentWidget(); + // fragile, widget's tqparent is the grid, whose tqparent is the tab page + TQWidget* w = widget->tqparentWidget()->tqparentWidget(); m_tabs->removePage(w); delete w; // automatically deletes child widget } else { // much of this replicates code in setLayout() - QGridLayout* layout = static_cast<QGridLayout*>(widget->parentWidget()->layout()); - delete widget; // automatically removes from layout + TQGridLayout* tqlayout = static_cast<TQGridLayout*>(widget->tqparentWidget()->tqlayout()); + delete widget; // automatically removes from tqlayout - QValueVector<bool> expands(NCOLS, false); - QValueVector<int> maxWidth(NCOLS, 0); + TQValueVector<bool> expands(NCOLS, false); + TQValueVector<int> maxWidth(NCOLS, 0); Data::FieldVec vec = m_currColl->fieldsByCategory(field_->category()); Data::FieldVec::Iterator it = vec.begin(); for(int count = 0; it != vec.end(); ++it) { - GUI::FieldWidget* widget = m_widgetDict.find(QString::number(m_currColl->id()) + it->name()); + GUI::FieldWidget* widget = m_widgetDict.tqfind(TQString::number(m_currColl->id()) + it->name()); if(widget) { - layout->remove(widget); - layout->addWidget(widget, count/NCOLS, count%NCOLS); + tqlayout->remove(widget); + tqlayout->addWidget(widget, count/NCOLS, count%NCOLS); - maxWidth[count%NCOLS] = QMAX(maxWidth[count%NCOLS], widget->labelWidth()); + maxWidth[count%NCOLS] = TQMAX(maxWidth[count%NCOLS], widget->labelWidth()); if(widget->expands()) { expands[count%NCOLS] = true; } @@ -592,7 +592,7 @@ void EntryEditDialog::removeField(Data::CollPtr, Data::FieldPtr field_) { // now, the labels in a column should all be the same width it = vec.begin(); for(int count = 0; it != vec.end(); ++it) { - GUI::FieldWidget* widget = m_widgetDict.find(QString::number(m_currColl->id()) + it->name()); + GUI::FieldWidget* widget = m_widgetDict.tqfind(TQString::number(m_currColl->id()) + it->name()); if(widget) { widget->setLabelWidth(maxWidth[count%NCOLS]); ++count; @@ -602,7 +602,7 @@ void EntryEditDialog::removeField(Data::CollPtr, Data::FieldPtr field_) { // update stretch factors for columns with a line edit for(int col = 0; col < NCOLS; ++col) { if(expands[col]) { - layout->setColStretch(col, 1); + tqlayout->setColStretch(col, 1); } } } @@ -624,14 +624,14 @@ void EntryEditDialog::updateCompletions(Data::EntryPtr entry_) { continue; } - QString key = QString::number(m_currColl->id()) + it->name(); - GUI::FieldWidget* widget = m_widgetDict.find(key); + TQString key = TQString::number(m_currColl->id()) + it->name(); + GUI::FieldWidget* widget = m_widgetDict.tqfind(key); if(!widget) { continue; } if(it->flags() & Data::Field::AllowMultiple) { - QStringList items = entry_->fields(it, false); - for(QStringList::ConstIterator it = items.begin(); it != items.end(); ++it) { + TQStringList items = entry_->fields(it, false); + for(TQStringList::ConstIterator it = items.begin(); it != items.end(); ++it) { widget->addCompletionObjectItem(*it); } } else { @@ -653,7 +653,7 @@ bool EntryEditDialog::queryModified() { m_modified = false; } if(m_modified) { - QString str(i18n("The current entry has been modified.\n" + TQString str(i18n("The current entry has been modified.\n" "Do you want to enter the changes?")); KGuiItem item = KStdGuiItem::save(); item.setText(i18n("Save Entry")); @@ -687,7 +687,7 @@ void EntryEditDialog::modifyField(Data::CollPtr coll_, Data::FieldPtr oldField_, m_currColl = coll_; } - // if the field type changed, go ahead and redo the whole layout + // if the field type changed, go ahead and redo the whole tqlayout // also if the category changed for a non-single field, since a new tab must be created if(oldField_->type() != newField_->type() || (oldField_->category() != newField_->category() && !newField_->isSingleCategory())) { @@ -698,28 +698,28 @@ void EntryEditDialog::modifyField(Data::CollPtr coll_, Data::FieldPtr oldField_, return; } - QString key = QString::number(coll_->id()) + oldField_->name(); + TQString key = TQString::number(coll_->id()) + oldField_->name(); GUI::FieldWidget* widget = m_widgetDict[key]; if(widget) { widget->updateField(oldField_, newField_); // need to update label widths if(newField_->title() != oldField_->title()) { int maxWidth = 0; - QObjectList* childList = widget->parentWidget()->queryList("Tellico::GUI::FieldWidget", 0, false, false); - QObjectListIt it(*childList); + TQObjectList* childList = widget->tqparentWidget()->queryList("Tellico::GUI::FieldWidget", 0, false, false); + TQObjectListIt it(*childList); for(it.toFirst(); it.current(); ++it) { - maxWidth = QMAX(maxWidth, static_cast<GUI::FieldWidget*>(it.current())->labelWidth()); + maxWidth = TQMAX(maxWidth, static_cast<GUI::FieldWidget*>(TQT_TQWIDGET(it.current()))->labelWidth()); } for(it.toFirst(); it.current(); ++it) { - static_cast<GUI::FieldWidget*>(it.current())->setLabelWidth(maxWidth); + static_cast<GUI::FieldWidget*>(TQT_TQWIDGET(it.current()))->setLabelWidth(maxWidth); } delete childList; } // this is very fragile! - // field widgets's parent is the grid, whose parent is the tab page + // field widgets's tqparent is the grid, whose tqparent is the tab page // this is for singleCategory fields if(newField_->category() != oldField_->category()) { - m_tabs->setTabLabel(widget->parentWidget()->parentWidget(), newField_->category()); + m_tabs->setTabLabel(widget->tqparentWidget()->tqparentWidget(), newField_->category()); } } } @@ -734,7 +734,7 @@ void EntryEditDialog::modifyEntries(Data::EntryVec entries_) { bool updateContents = false; for(Data::EntryVecIt entry = entries_.begin(); entry != entries_.end(); ++entry) { updateCompletions(entry); - if(!updateContents && m_currEntries.contains(entry)) { + if(!updateContents && m_currEntries.tqcontains(entry)) { updateContents = true; } } |