diff --git a/.hgignore b/.hgignore
index 2868de36..011146d3 100644
--- a/.hgignore
+++ b/.hgignore
@@ -65,7 +65,6 @@ src/qt4gui/qrc_recoll.cpp
src/qt4gui/recoll
src/qt4gui/recoll.pro
src/qt4gui/sort.ui
-src/qt4gui/spell.ui
src/qt4gui/ssearchb.ui
src/qt4gui/uiprefs.ui
src/qt4gui/viewaction.ui
diff --git a/src/qt4gui/recollmain.ui b/src/qt4gui/recollmain.ui
deleted file mode 100644
index 4618b408..00000000
--- a/src/qt4gui/recollmain.ui
+++ /dev/null
@@ -1,315 +0,0 @@
-
-
-
-
- RclMain
-
-
-
- 0
- 0
- 681
- 244
-
-
-
-
- 5
- 5
- 0
- 0
-
-
-
-
- 16
- 115
-
-
-
- Recoll
-
-
-
-
- 11
-
-
- 6
-
- -
-
-
- 0
-
-
- 6
-
-
-
-
-
-
- 5
- 0
- 0
- 0
-
-
-
-
- -
-
-
-
- 5
- 5
- 2
- 0
-
-
-
-
-
-
-
-
-
-
- Qt::Horizontal
-
-
- 4
-
-
-
-
-
-
-
- Qt::Horizontal
-
-
- 4
-
-
-
-
-
-
-
- E&xit
-
-
- Exit
-
-
- Ctrl+Q
-
-
-
-
- Update &index
-
-
- Update index
-
-
-
-
- &About Recoll
-
-
- About Recoll
-
-
-
-
- &User manual
-
-
- User manual
-
-
-
-
- :/icons/images/history.png
-
-
- Document &History
-
-
- Document &History
-
-
- Document History
-
-
-
-
- :/icons/images/asearch.png
-
-
- &Advanced Search
-
-
- Advanced Search
-
-
- Advanced/complex Search
-
-
-
-
- :/icons/images/sortparms.png
-
-
- &Sort parameters
-
-
- &Sort parameters
-
-
- Sort parameters
-
-
-
-
- false
-
-
- :/icons/images/nextpage.png
-
-
- Next page
-
-
- Next page of results
-
-
-
-
- false
-
-
- :/icons/images/prevpage.png
-
-
- Previous page
-
-
- Previous page of results
-
-
-
-
- &Query configuration
-
-
- &Query configuration
-
-
-
-
-
-
-
- SSearchBase
- QWidget
-
- 0
-
-
-
- RclResList
- QWidget
-
- 0
-
-
-
-
- ssearchb.h
- rclreslist.h
-
-
-
-
-
-
- prevPageAction
- activated()
- resList
- resultPageBack()
-
-
- -1
- -1
-
-
- 20
- 20
-
-
-
-
- nextPageAction
- activated()
- resList
- showResultPage()
-
-
- -1
- -1
-
-
- 20
- 20
-
-
-
-
-
diff --git a/src/qt4gui/spell.ui b/src/qt4gui/spell.ui
new file mode 100644
index 00000000..06d9256f
--- /dev/null
+++ b/src/qt4gui/spell.ui
@@ -0,0 +1,124 @@
+
+
+ SpellBase
+
+
+
+ 0
+ 0
+ 400
+ 300
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 100
+ 100
+
+
+
+ Term Explorer
+
+
+ -
+
+
-
+
+
-
+
+
+
+ 100
+ 0
+
+
+
+
+ -
+
+
+ false
+
+
+ Qt::NoFocus
+
+
+ &Expand
+
+
+ Alt+E
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ true
+
+
+ Qt::NoFocus
+
+
+ &Close
+
+
+ Alt+C
+
+
+
+
+
+
+
+ -
+
+
+ 2
+
+
+ 2
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ qPixmapFromMimeSource
+
+ baseWordLE
+ expandPB
+ dismissPB
+ expTypeCMB
+ stemLangCMB
+
+
+
+
diff --git a/src/qt4gui/uifrom3 b/src/qt4gui/uifrom3
index 38f936af..0042844e 100644
--- a/src/qt4gui/uifrom3
+++ b/src/qt4gui/uifrom3
@@ -2,7 +2,7 @@
# by "configure"
# Convert the uic files from qt3 to qt4.
-UIFILES = advsearch.ui preview.ui sort.ui spell.ui \
+UIFILES = advsearch.ui preview.ui sort.ui \
ssearchb.ui uiprefs.ui viewaction.ui
all: always $(UIFILES)
@@ -13,8 +13,6 @@ preview.ui : ../qtgui/preview.ui
uic3 -convert ../qtgui/preview.ui > preview.ui
sort.ui : ../qtgui/sort.ui
uic3 -convert ../qtgui/sort.ui > sort.ui
-spell.ui : ../qtgui/spell.ui
- uic3 -convert ../qtgui/spell.ui > spell.ui
ssearchb.ui : ../qtgui/ssearchb.ui
uic3 -convert ../qtgui/ssearchb.ui > ssearchb.ui
uiprefs.ui : ../qtgui/uiprefs.ui
diff --git a/src/qtgui/spell_w.cpp b/src/qtgui/spell_w.cpp
index a0185959..985a2d15 100644
--- a/src/qtgui/spell_w.cpp
+++ b/src/qtgui/spell_w.cpp
@@ -34,10 +34,7 @@ static char rcsid[] = "@(#$Id: spell_w.cpp,v 1.11 2007-02-19 16:28:05 dockes Exp
#if (QT_VERSION < 0x040000)
#include
#else
-#define QListView Q3ListView
-#define QListViewItem Q3ListViewItem
-#define QListViewItemIterator Q3ListViewItemIterator
-#include
+#include
#endif
#include "debuglog.h"
@@ -92,24 +89,30 @@ void SpellW::init()
connect(baseWordLE, SIGNAL(returnPressed()), this, SLOT(doExpand()));
connect(expandPB, SIGNAL(clicked()), this, SLOT(doExpand()));
connect(dismissPB, SIGNAL(clicked()), this, SLOT(close()));
+ connect(expTypeCMB, SIGNAL(activated(int)), this, SLOT(modeSet(int)));
- connect(suggsLV,
#if (QT_VERSION < 0x040000)
- SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)),
+ connect(suggsLV,
+ SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)),
+ this, SLOT(textDoubleClicked()));
+ // No initial sorting: user can choose to establish one
+ suggsLV->setSorting(100, false);
#else
- SIGNAL(doubleClicked(Q3ListViewItem *, const QPoint &, int)),
+ QStringList labels(tr("Term"));
+ labels.push_back(tr("Count"));
+ suggsLV->setHorizontalHeaderLabels(labels);
+ suggsLV->setShowGrid(0);
+ suggsLV->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
+ connect(suggsLV,
+ SIGNAL(cellDoubleClicked(int, int)),
+ this, SLOT(textDoubleClicked(int, int)));
#endif
- this, SLOT(textDoubleClicked()));
-
- connect(expTypeCMB, SIGNAL(activated(int)),
- this, SLOT(modeSet(int)));
suggsLV->setColumnWidth(0, 200);
suggsLV->setColumnWidth(1, 100);
- // No initial sorting: user can choose to establish one
- suggsLV->setSorting(100, false);
}
+#if (QT_VERSION < 0x040000)
// Subclass qlistviewitem for numeric sorting on column 1
class MyListViewItem : public QListViewItem
{
@@ -127,12 +130,20 @@ public:
return 0;
}
};
+#else
+#endif
+
/* Expand term according to current mode */
void SpellW::doExpand()
{
+ // Can't clear qt4 table widget: resets column headers too
+#if (QT_VERSION < 0x040000)
suggsLV->clear();
+#else
+ suggsLV->setRowCount(0);
+#endif
if (baseWordLE->text().isEmpty())
return;
@@ -193,22 +204,42 @@ void SpellW::doExpand()
if (entries.empty()) {
+#if (QT_VERSION < 0x040000)
new MyListViewItem(suggsLV, tr("No expansion found"), "");
+#else
+ suggsLV->setItem(0, 0, new QTableWidgetItem(tr("No expansion found")));
+#endif
} else {
- // Seems that need to use a reverse iterator to get same order in
- // listview and input list ??
+ int row = 0;
+#if (QT_VERSION < 0x040000)
for (list::reverse_iterator it = entries.rbegin();
it != entries.rend(); it++) {
+#else
+ for (list::iterator it = entries.begin();
+ it != entries.end(); it++) {
+#endif
LOGDEB(("SpellW::expand: %6d [%s]\n", it->wcf, it->term.c_str()));
char num[20];
if (it->wcf)
sprintf(num, "%d", it->wcf);
else
num[0] = 0;
+#if (QT_VERSION < 0x040000)
new MyListViewItem(suggsLV,
QString::fromUtf8(it->term.c_str()),
QString::fromAscii(num));
+#else
+ if (suggsLV->rowCount() <= row)
+ suggsLV->setRowCount(row+1);
+ suggsLV->setItem(row, 0,
+ new QTableWidgetItem(QString::fromUtf8(it->term.c_str())));
+ suggsLV->setItem(row++, 1,
+ new QTableWidgetItem(QString::fromAscii(num)));
+#endif
}
+#if (QT_VERSION >= 0x040000)
+ suggsLV->setRowCount(row+1);
+#endif
}
}
@@ -222,8 +253,13 @@ void SpellW::wordChanged(const QString &text)
}
}
+#if (QT_VERSION < 0x040000)
void SpellW::textDoubleClicked()
+#else
+void SpellW::textDoubleClicked(int row, int)
+#endif
{
+#if (QT_VERSION < 0x040000)
QListViewItemIterator it(suggsLV);
while (it.current()) {
QListViewItem *item = it.current();
@@ -234,6 +270,11 @@ void SpellW::textDoubleClicked()
emit(wordSelect((const char *)item->text(0)));
++it;
}
+#else
+ QTableWidgetItem *item = suggsLV->item(row, 0);
+ if (item)
+ emit(wordSelect(item->text()));
+#endif
}
void SpellW::modeSet(int mode)
diff --git a/src/qtgui/spell_w.h b/src/qtgui/spell_w.h
index 38df7e44..d5cbb82f 100644
--- a/src/qtgui/spell_w.h
+++ b/src/qtgui/spell_w.h
@@ -53,7 +53,11 @@ public:
public slots:
virtual void doExpand();
virtual void wordChanged(const QString&);
+#if (QT_VERSION < 0x040000)
virtual void textDoubleClicked();
+#else
+ virtual void textDoubleClicked(int, int);
+#endif
virtual void modeSet(int);
signals: