diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-17 08:20:48 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-17 08:20:48 +0000 |
commit | aa0726b20f398264f0a2abc60215be044b106f9c (patch) | |
tree | 070fdbc19a1106cfdd7f651a8ce76bb1b89a513d /src/filter.cpp | |
parent | d3cf5b3e75aadc3b02d0b56f030d4c3f8c2c749d (diff) | |
download | basket-aa0726b20f398264f0a2abc60215be044b106f9c.tar.gz basket-aa0726b20f398264f0a2abc60215be044b106f9c.zip |
TQt4 port basket
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/basket@1232416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/filter.cpp')
-rw-r--r-- | src/filter.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/filter.cpp b/src/filter.cpp index 57aa4ae..9d4a74c 100644 --- a/src/filter.cpp +++ b/src/filter.cpp @@ -18,21 +18,21 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qlayout.h> +#include <tqlayout.h> //#include <ktoolbarbutton.h> -#include <qtoolbutton.h> -#include <qlabel.h> -//#include <qcombobox.h> +#include <tqtoolbutton.h> +#include <tqlabel.h> +//#include <tqcombobox.h> //#include <klineedit.h> #include <kiconloader.h> #include <klocale.h> #include <kglobalsettings.h> #include <kapplication.h> #include <kiconloader.h> -#include <qpixmap.h> -#include <qimage.h> -#include <qpainter.h> -#include <qbitmap.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqbitmap.h> #include <kdialogbase.h> #include "filter.h" @@ -45,28 +45,28 @@ /** FilterBar */ -FilterBar::FilterBar(QWidget *parent, const char *name) - : QWidget(parent, name)/*, m_blinkTimer(this), m_blinkedTimes(0)*/ +FilterBar::FilterBar(TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name)/*, m_blinkTimer(this), m_blinkedTimes(0)*/ { - QHBoxLayout *hBox = new QHBoxLayout(this, /*margin*/0, /*spacing*/0); + TQHBoxLayout *hBox = new TQHBoxLayout(this, /*margin*/0, /*spacing*/0); // Create every widgets: - QIconSet resetIconSet = kapp->iconLoader()->loadIconSet("locationbar_erase", KIcon::Toolbar); - QIconSet inAllIconSet = kapp->iconLoader()->loadIconSet("find", KIcon::Toolbar); + TQIconSet resetIconSet = kapp->iconLoader()->loadIconSet("locationbar_erase", KIcon::Toolbar); + TQIconSet inAllIconSet = kapp->iconLoader()->loadIconSet("tqfind", KIcon::Toolbar); - m_resetButton = new QToolButton(this); + m_resetButton = new TQToolButton(this); m_resetButton->setIconSet(resetIconSet); - m_resetButton->setTextLabel(i18n("Reset Filter"));//, /*groupText=*/"", this, SLOT(reset()), 0); + m_resetButton->setTextLabel(i18n("Reset Filter"));//, /*groupText=*/"", this, TQT_SLOT(reset()), 0); m_resetButton->setAutoRaise(true); //new KToolBarButton("locationbar_erase", /*id=*/1230, this, /*name=*/0, i18n("Reset Filter")); m_lineEdit = new FocusedLineEdit(this); - QLabel *label = new QLabel(m_lineEdit, i18n("&Filter: "), this); + TQLabel *label = new TQLabel(m_lineEdit, i18n("&Filter: "), this); m_tagsBox = new FocusedComboBox(this); - QLabel *label2 = new QLabel(m_tagsBox, i18n("T&ag: "), this); - m_inAllBasketsButton = new QToolButton(this); + TQLabel *label2 = new TQLabel(m_tagsBox, i18n("T&ag: "), this); + m_inAllBasketsButton = new TQToolButton(this); m_inAllBasketsButton->setIconSet(inAllIconSet); - m_inAllBasketsButton->setTextLabel(i18n("Filter all Baskets"));//, /*groupText=*/"", this, SLOT(inAllBaskets()), 0); + m_inAllBasketsButton->setTextLabel(i18n("Filter all Baskets"));//, /*groupText=*/"", this, TQT_SLOT(inAllBaskets()), 0); m_inAllBasketsButton->setAutoRaise(true); // Configure the Reset button: @@ -96,18 +96,18 @@ FilterBar::FilterBar(QWidget *parent, const char *name) m_data = new FilterData(); // TODO: Not a pointer! and return a const & !! -// connect( &m_blinkTimer, SIGNAL(timeout()), this, SLOT(blinkBar()) ); - connect( m_resetButton, SIGNAL(clicked()), this, SLOT(reset()) ); - connect( m_lineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&)) ); - connect( m_tagsBox, SIGNAL(activated(int)), this, SLOT(tagChanged(int)) ); +// connect( &m_blinkTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(blinkBar()) ); + connect( m_resetButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reset()) ); + connect( m_lineEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(textChanged(const TQString&)) ); + connect( m_tagsBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(tagChanged(int)) ); -// connect( m_inAllBasketsButton, SIGNAL(clicked()), this, SLOT(inAllBaskets()) ); - connect( m_inAllBasketsButton, SIGNAL(toggled(bool)), Global::bnpView, SLOT(toggleFilterAllBaskets(bool)) ); +// connect( m_inAllBasketsButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(inAllBaskets()) ); + connect( m_inAllBasketsButton, TQT_SIGNAL(toggled(bool)), Global::bnpView, TQT_SLOT(toggleFilterAllBaskets(bool)) ); - connect( m_lineEdit, SIGNAL(escapePressed()), this, SIGNAL(escapePressed()) ); - connect( m_lineEdit, SIGNAL(returnPressed()), this, SIGNAL(returnPressed()) ); - connect( m_tagsBox, SIGNAL(escapePressed()), this, SIGNAL(escapePressed()) ); - connect( m_tagsBox, SIGNAL(returnPressed2()), this, SIGNAL(returnPressed()) ); + connect( m_lineEdit, TQT_SIGNAL(escapePressed()), this, TQT_SIGNAL(escapePressed()) ); + connect( m_lineEdit, TQT_SIGNAL(returnPressed()), this, TQT_SIGNAL(returnPressed()) ); + connect( m_tagsBox, TQT_SIGNAL(escapePressed()), this, TQT_SIGNAL(escapePressed()) ); + connect( m_tagsBox, TQT_SIGNAL(returnPressed2()), this, TQT_SIGNAL(returnPressed()) ); } FilterBar::~FilterBar() @@ -154,9 +154,9 @@ void FilterBar::repopulateTagsComnbo() int index = 3; Tag *tag; State *state; - QString icon; - QString text; - QPixmap emblem; + TQString icon; + TQString text; + TQPixmap emblem; for (Tag::List::iterator it = Tag::all.begin(); it != Tag::all.end(); ++it) { tag = *it; state = tag->states().first(); @@ -206,7 +206,7 @@ void FilterBar::filterTag(Tag *tag) { int index = 0; - for (QMap<int, Tag*>::Iterator it = m_tagsMap.begin(); it != m_tagsMap.end(); ++it) + for (TQMap<int, Tag*>::Iterator it = m_tagsMap.begin(); it != m_tagsMap.end(); ++it) if (it.data() == tag) { index = it.key(); break; @@ -224,7 +224,7 @@ void FilterBar::filterState(State *state) { int index = 0; - for (QMap<int, State*>::Iterator it = m_statesMap.begin(); it != m_statesMap.end(); ++it) + for (TQMap<int, State*>::Iterator it = m_statesMap.begin(); it != m_statesMap.end(); ++it) if (it.data() == state) { index = it.key(); break; @@ -258,7 +258,7 @@ const FilterData& FilterBar::filterData() return *m_data; } -void FilterBar::textChanged(const QString &text) +void FilterBar::textChanged(const TQString &text) { m_data->string = text; m_data->isFiltering = (!m_data->string.isEmpty() || m_data->tagFilterType != FilterData::DontCareTagsFilter); @@ -282,13 +282,13 @@ void FilterBar::tagChanged(int index) break; default: // Try to find if we are filtering a tag: - QMapIterator<int, Tag*> it = m_tagsMap.find(index); + TQMapIterator<int, Tag*> it = m_tagsMap.tqfind(index); if (it != m_tagsMap.end()) { m_data->tagFilterType = FilterData::TagFilter; m_data->tag = *it; } else { // If not, try to find if we are filtering a state: - QMapIterator<int, State*> it2 = m_statesMap.find(index); + TQMapIterator<int, State*> it2 = m_statesMap.tqfind(index); if (it2 != m_statesMap.end()) { m_data->tagFilterType = FilterData::StateFilter; m_data->state = *it2; |