summaryrefslogtreecommitdiffstats
path: root/kexi/widget/kexisectionheader.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/widget/kexisectionheader.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/widget/kexisectionheader.cpp')
-rw-r--r--kexi/widget/kexisectionheader.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/kexi/widget/kexisectionheader.cpp b/kexi/widget/kexisectionheader.cpp
index 42c5031e..7bc3fe5f 100644
--- a/kexi/widget/kexisectionheader.cpp
+++ b/kexi/widget/kexisectionheader.cpp
@@ -21,21 +21,21 @@
#include "kexiviewbase.h"
#include <kexiutils/utils.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qhbox.h>
-#include <qtooltip.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqtooltip.h>
#include <kiconloader.h>
#include <kpushbutton.h>
-class KexiSectionHeader::BoxLayout : public QBoxLayout
+class KexiSectionHeader::BoxLayout : public TQBoxLayout
{
public:
- BoxLayout( KexiSectionHeader* parent, Direction d, int margin = 0,
+ BoxLayout( KexiSectionHeader* tqparent, Direction d, int margin = 0,
int spacing = -1, const char * name = 0 );
- virtual void addItem( QLayoutItem * item );
- QGuardedPtr<KexiViewBase> view;
+ virtual void addItem( TQLayoutItem * item );
+ TQGuardedPtr<KexiViewBase> view;
};
//==========================
@@ -49,24 +49,24 @@ class KexiSectionHeaderPrivate
}
Qt::Orientation orientation;
- QLabel *lbl;
+ TQLabel *lbl;
KexiSectionHeader::BoxLayout *lyr;
- QHBox *lbl_b;
+ TQHBox *lbl_b;
};
//==========================
-KexiSectionHeader::KexiSectionHeader(const QString &caption, Orientation o, QWidget* parent )
- : QWidget(parent, "KexiSectionHeader")
+KexiSectionHeader::KexiSectionHeader(const TQString &caption, Qt::Orientation o, TQWidget* tqparent )
+ : TQWidget(tqparent, "KexiSectionHeader")
, d( new KexiSectionHeaderPrivate() )
{
d->orientation = o;
- d->lyr = new BoxLayout( this, d->orientation==Vertical ? QBoxLayout::TopToBottom : QBoxLayout::LeftToRight );
+ d->lyr = new BoxLayout( this, d->orientation==Qt::Vertical ? TQBoxLayout::TopToBottom : TQBoxLayout::LeftToRight );
d->lyr->setAutoAdd(true);
- d->lbl_b = new QHBox(this);
- d->lbl = new QLabel(QString(" ")+caption, d->lbl_b);
- d->lbl->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
- d->lbl->setFocusPolicy(StrongFocus);
+ d->lbl_b = new TQHBox(this);
+ d->lbl = new TQLabel(TQString(" ")+caption, d->lbl_b);
+ d->lbl->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Preferred);
+ d->lbl->setFocusPolicy(TQ_StrongFocus);
d->lbl->installEventFilter(this);
installEventFilter(this);
setCaption(caption);
@@ -77,55 +77,55 @@ KexiSectionHeader::~KexiSectionHeader()
delete d;
}
-void KexiSectionHeader::addButton(const QString& icon, const QString& toolTip,
- const QObject * receiver, const char * member)
+void KexiSectionHeader::addButton(const TQString& icon, const TQString& toolTip,
+ const TQObject * receiver, const char * member)
{
KPushButton *btn = new KPushButton(d->lbl_b);
btn->setFlat(true);
- btn->setFocusPolicy(NoFocus);
- btn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
+ btn->setFocusPolicy(TQ_NoFocus);
+ btn->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred);
if (receiver && member) {
- connect(btn, SIGNAL(clicked()), receiver, member);
+ connect(btn, TQT_SIGNAL(clicked()), receiver, member);
}
if (!icon.isEmpty()) {
- QIconSet iset = SmallIconSet(icon);
+ TQIconSet iset = SmallIconSet(icon);
btn->setIconSet( iset );
- QFontMetrics fm(d->lbl->font());
- btn->setMaximumHeight( QMAX(fm.height(), 16) );
+ TQFontMetrics fm(d->lbl->font());
+ btn->setMaximumHeight( TQMAX(fm.height(), 16) );
}
if (!toolTip.isEmpty()) {
- QToolTip::add(btn, toolTip);
+ TQToolTip::add(btn, toolTip);
}
}
-bool KexiSectionHeader::eventFilter( QObject *o, QEvent *e )
+bool KexiSectionHeader::eventFilter( TQObject *o, TQEvent *e )
{
- if (o == d->lbl && e->type()==QEvent::MouseButtonRelease) {//|| e->type()==QEvent::FocusOut) {// && o->inherits("QWidget")) {
+ if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(d->lbl) && e->type()==TQEvent::MouseButtonRelease) {//|| e->type()==TQEvent::FocusOut) {// && o->inherits(TQWIDGET_OBJECT_NAME_STRING)) {
if (d->lyr->view)
d->lyr->view->setFocus();
-// if (KexiUtils::hasParent( this, static_cast<QWidget*>(o))) {
-// d->lbl->setPaletteBackgroundColor( e->type()==QEvent::FocusIn ? red : blue);
+// if (KexiUtils::hasParent( this, static_cast<TQWidget*>(o))) {
+// d->lbl->setPaletteBackgroundColor( e->type()==TQEvent::FocusIn ? red : blue);
// }
}
- return QWidget::eventFilter(o,e);
+ return TQWidget::eventFilter(o,e);
}
void KexiSectionHeader::slotFocus(bool in)
{
- in = in || focusWidget()==this;
+ in = in || tqfocusWidget()==this;
d->lbl->setPaletteBackgroundColor(
- in ? palette().active().color(QColorGroup::Highlight) : palette().active().color(QColorGroup::Background) );
+ in ? tqpalette().active().color(TQColorGroup::Highlight) : tqpalette().active().color(TQColorGroup::Background) );
d->lbl->setPaletteForegroundColor(
- in ? palette().active().color(QColorGroup::HighlightedText) : palette().active().color(QColorGroup::Foreground) );
+ in ? tqpalette().active().color(TQColorGroup::HighlightedText) : tqpalette().active().color(TQColorGroup::Foreground) );
}
-QSize KexiSectionHeader::sizeHint() const
+TQSize KexiSectionHeader::tqsizeHint() const
{
if (!d->lyr->view)
- return QWidget::sizeHint();
- QSize s = d->lyr->view->sizeHint();
- return QSize(s.width(), d->lbl->sizeHint().height() + s.height());
+ return TQWidget::tqsizeHint();
+ TQSize s = d->lyr->view->tqsizeHint();
+ return TQSize(s.width(), d->lbl->tqsizeHint().height() + s.height());
}
/*void KexiSectionHeader::setFocus()
@@ -133,25 +133,25 @@ QSize KexiSectionHeader::sizeHint() const
if (d->lyr->view)
d->lyr->view->setFocus();
else
- QWidget::setFocus();
+ TQWidget::setFocus();
}*/
//======================
-KexiSectionHeader::BoxLayout::BoxLayout( KexiSectionHeader* parent, Direction d, int margin, int spacing, const char * name )
- : QBoxLayout(parent, d, margin, spacing, name )
+KexiSectionHeader::BoxLayout::BoxLayout( KexiSectionHeader* tqparent, Direction d, int margin, int spacing, const char * name )
+ : TQBoxLayout(tqparent, d, margin, spacing, name )
{
}
-void KexiSectionHeader::BoxLayout::addItem( QLayoutItem * item )
+void KexiSectionHeader::BoxLayout::addItem( TQLayoutItem * item )
{
- QBoxLayout::addItem( item );
+ TQBoxLayout::addItem( item );
if (item->widget()) {
item->widget()->installEventFilter( mainWidget() );
if (item->widget()->inherits("KexiViewBase")) {
view = static_cast<KexiViewBase*>(item->widget());
KexiSectionHeader *sh = static_cast<KexiSectionHeader*>(mainWidget());
- connect(view,SIGNAL(focus(bool)),sh,SLOT(slotFocus(bool)));
+ connect(view,TQT_SIGNAL(focus(bool)),sh,TQT_SLOT(slotFocus(bool)));
sh->d->lbl->setBuddy(item->widget());
}
}