diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/plugins/reports | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-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/plugins/reports')
-rw-r--r-- | kexi/plugins/reports/kexireportfactory.cpp | 62 | ||||
-rw-r--r-- | kexi/plugins/reports/kexireportfactory.h | 29 | ||||
-rw-r--r-- | kexi/plugins/reports/kexireportform.cpp | 92 | ||||
-rw-r--r-- | kexi/plugins/reports/kexireportform.h | 27 | ||||
-rw-r--r-- | kexi/plugins/reports/kexireportpart.cpp | 20 | ||||
-rw-r--r-- | kexi/plugins/reports/kexireportpart.h | 23 | ||||
-rw-r--r-- | kexi/plugins/reports/kexireportview.cpp | 112 | ||||
-rw-r--r-- | kexi/plugins/reports/kexireportview.h | 16 | ||||
-rw-r--r-- | kexi/plugins/reports/reportwidgets.cpp | 56 | ||||
-rw-r--r-- | kexi/plugins/reports/reportwidgets.h | 58 |
10 files changed, 252 insertions, 243 deletions
diff --git a/kexi/plugins/reports/kexireportfactory.cpp b/kexi/plugins/reports/kexireportfactory.cpp index 0ac782c4..d863bc9f 100644 --- a/kexi/plugins/reports/kexireportfactory.cpp +++ b/kexi/plugins/reports/kexireportfactory.cpp @@ -16,8 +16,8 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <qpopupmenu.h> -#include <qvaluevector.h> +#include <tqpopupmenu.h> +#include <tqvaluevector.h> #include <kgenericfactory.h> #include <klocale.h> @@ -33,8 +33,8 @@ #include "reportwidgets.h" #include "kexireportfactory.h" -KexiReportFactory::KexiReportFactory(QObject *parent, const char *name, const QStringList &) - : KFormDesigner::WidgetFactory(parent, name) +KexiReportFactory::KexiReportFactory(TQObject *tqparent, const char *name, const TQStringList &) + : KFormDesigner::WidgetFactory(tqparent, name) { KFormDesigner::WidgetInfo *wView = new KFormDesigner::WidgetInfo(this); wView->setPixmap("report"); @@ -86,20 +86,20 @@ KexiReportFactory::~KexiReportFactory() { } -QString +TQString KexiReportFactory::name() { return "kexireportwidgets"; } -QWidget* -KexiReportFactory::createWidget(const QCString &c, QWidget *p, const char *n, +TQWidget* +KexiReportFactory::createWidget(const TQCString &c, TQWidget *p, const char *n, KFormDesigner::Container *container, int options) { Q_UNUSED(options); kexipluginsdbg << "KexiReportFactory::create() " << this << endl; - QString text( container->form()->library()->textForWidgetName(n, c) ); + TQString text( container->form()->library()->textForWidgetName(n, c) ); if(c == "Label") return new Label(text, p, n); @@ -114,56 +114,56 @@ KexiReportFactory::createWidget(const QCString &c, QWidget *p, const char *n, } bool -KexiReportFactory::createMenuActions(const QCString &classname, QWidget *w, - QPopupMenu *menu, KFormDesigner::Container *container) +KexiReportFactory::createMenuActions(const TQCString &classname, TQWidget *w, + TQPopupMenu *menu, KFormDesigner::Container *container) { Q_UNUSED(w); Q_UNUSED(container); if(classname == "Label") { /*! @todo use KAction */ - menu->insertItem(SmallIconSet("edit"), i18n("Edit Rich Text"), this, SLOT(editText())); + menu->insertItem(SmallIconSet("edit"), i18n("Edit Rich Text"), this, TQT_SLOT(editText())); return true; } return false; } bool -KexiReportFactory::startEditing(const QCString &c, QWidget *w, KFormDesigner::Container *container) +KexiReportFactory::startEditing(const TQCString &c, TQWidget *w, KFormDesigner::Container *container) { m_container = container; if(c == "Label") { - QLabel *label = static_cast<QLabel*>(w); + TQLabel *label = static_cast<TQLabel*>(w); if(label->textFormat() == RichText) { m_widget = w; editText(); } else - createEditor(c, label->text(), label, container, label->geometry(), label->alignment()); + createEditor(c, label->text(), label, container, label->tqgeometry(), label->tqalignment()); return true; } return false; } bool -KexiReportFactory::isPropertyVisibleInternal(const QCString &classname, QWidget *w, const QCString &property, bool isTopLevel) +KexiReportFactory::isPropertyVisibleInternal(const TQCString &classname, TQWidget *w, const TQCString &property, bool isTopLevel) { if(classname == "Label") { if(property == "pixmap") return false; } else if(classname == "PicLabel") { - if((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "alignment")) + if((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "tqalignment")) return false; } return WidgetFactory::isPropertyVisibleInternal(classname, w, property, isTopLevel); } -QValueList<QCString> -KexiReportFactory::autoSaveProperties(const QCString &classname) +TQValueList<TQCString> +KexiReportFactory::autoSaveProperties(const TQCString &classname) { - QValueList<QCString> l; + TQValueList<TQCString> l; if(classname == "Label") l << "text"; @@ -175,23 +175,23 @@ KexiReportFactory::autoSaveProperties(const QCString &classname) /* void -KexiReportFactory::changeText(const QString &text) +KexiReportFactory::changeText(const TQString &text) { - QWidget *w = WidgetFactory::m_widget; + TQWidget *w = WidgetFactory::m_widget; changeProperty("text", text, m_container); - int width = w->sizeHint().width(); + int width = w->tqsizeHint().width(); if(w->width() < width) w->resize(width, w->height() ); } void -KexiReportFactory::resizeEditor(QWidget *widget, const QCString &) +KexiReportFactory::resizeEditor(TQWidget *widget, const TQCString &) { - QSize s = widget->size(); - QPoint p = widget->pos(); - QRect r; + TQSize s = widget->size(); + TQPoint p = widget->pos(); + TQRect r; m_editor->resize(s); m_editor->move(p); @@ -200,11 +200,11 @@ KexiReportFactory::resizeEditor(QWidget *widget, const QCString &) void KexiReportFactory::editText() { - QCString classname = m_widget->className(); - QString text; + TQCString classname = m_widget->className(); + TQString text; if(classname == "Label") - text = ((QLabel*)m_widget)->text(); + text = ((TQLabel*)m_widget)->text(); if(editRichText(m_widget, text)) { changeProperty("textFormat", "RichText", m_container->form()); @@ -212,11 +212,11 @@ KexiReportFactory::editText() } if(classname == "Label") - m_widget->resize(m_widget->sizeHint()); + m_widget->resize(m_widget->tqsizeHint()); } bool -KexiReportFactory::previewWidget(const QCString &, QWidget *, KFormDesigner::Container *) +KexiReportFactory::previewWidget(const TQCString &, TQWidget *, KFormDesigner::Container *) { return false; } diff --git a/kexi/plugins/reports/kexireportfactory.h b/kexi/plugins/reports/kexireportfactory.h index c6b91702..ab2ce7a1 100644 --- a/kexi/plugins/reports/kexireportfactory.h +++ b/kexi/plugins/reports/kexireportfactory.h @@ -26,35 +26,36 @@ class KexiReportFactory : public KFormDesigner::WidgetFactory { Q_OBJECT + TQ_OBJECT public: - KexiReportFactory(QObject *parent, const char *name, const QStringList &args); + KexiReportFactory(TQObject *tqparent, const char *name, const TQStringList &args); virtual ~KexiReportFactory(); - virtual QString name(); - virtual QWidget *createWidget(const QCString &classname, QWidget *parent, const char *name, KFormDesigner::Container *container, + virtual TQString name(); + virtual TQWidget *createWidget(const TQCString &classname, TQWidget *tqparent, const char *name, KFormDesigner::Container *container, int options = DefaultOptions); - virtual bool createMenuActions(const QCString &classname, QWidget *w, QPopupMenu *menu, + virtual bool createMenuActions(const TQCString &classname, TQWidget *w, TQPopupMenu *menu, KFormDesigner::Container *container); - virtual bool startEditing(const QCString &classname, QWidget *w, KFormDesigner::Container *container); - virtual bool previewWidget(const QCString &, QWidget *, KFormDesigner::Container *); + virtual bool startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container); + virtual bool previewWidget(const TQCString &, TQWidget *, KFormDesigner::Container *); - //virtual void saveSpecialProperty(const QString &classname, const QString &name, const QVariant &value, QWidget *w, - //QDomElement &parentNode, QDomDocument &parent) {} - //virtual void readSpecialProperty(const QCString &classname, QDomElement &node, QWidget *w, KFormDesigner::ObjectTreeItem *item) {} - virtual QValueList<QCString> autoSaveProperties(const QCString &classname); + //virtual void saveSpecialProperty(const TQString &classname, const TQString &name, const TQVariant &value, TQWidget *w, + //TQDomElement &tqparentNode, TQDomDocument &tqparent) {} + //virtual void readSpecialProperty(const TQCString &classname, TQDomElement &node, TQWidget *w, KFormDesigner::ObjectTreeItem *item) {} + virtual TQValueList<TQCString> autoSaveProperties(const TQCString &classname); public slots: void editText(); protected: - virtual bool isPropertyVisibleInternal(const QCString &, QWidget *, const QCString &, bool isTopLevel); -// virtual void changeText(const QString &newText); -// virtual void resizeEditor(QWidget *widget, const QCString &classname); + virtual bool isPropertyVisibleInternal(const TQCString &, TQWidget *, const TQCString &, bool isTopLevel); +// virtual void changeText(const TQString &newText); +// virtual void resizeEditor(TQWidget *widget, const TQCString &classname); private: - QWidget *m_widget; + TQWidget *m_widget; KFormDesigner::Container *m_container; }; diff --git a/kexi/plugins/reports/kexireportform.cpp b/kexi/plugins/reports/kexireportform.cpp index d5dd6f55..f77b41a5 100644 --- a/kexi/plugins/reports/kexireportform.cpp +++ b/kexi/plugins/reports/kexireportform.cpp @@ -18,20 +18,20 @@ * Boston, MA 02110-1301, USA. */ -#include <qobjectlist.h> -#include <qpainter.h> -#include <qcursor.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqcursor.h> #include <kdebug.h> #include "kexireportform.h" -KexiReportForm::KexiReportForm(QWidget *parent, const char *name/*, KexiDB::Connection *conn*/) - : QWidget(parent, name) +KexiReportForm::KexiReportForm(TQWidget *tqparent, const char *name/*, KexiDB::Connection *conn*/) + : TQWidget(tqparent, name) { //m_conn = conn; kexipluginsdbg << "KexiReportForm::KexiReportForm(): " << endl; - setCursor(QCursor(Qt::ArrowCursor)); //to avoid keeping Size cursor when moving from form's boundaries + setCursor(TQCursor(TQt::ArrowCursor)); //to avoid keeping Size cursor when moving from form's boundaries setBackgroundColor(white); } @@ -40,47 +40,47 @@ KexiReportForm::~KexiReportForm() kexipluginsdbg << "KexiReportForm::~KexiReportForm(): close" << endl; } -//repaint all children widgets -static void repaintAll(QWidget *w) +//tqrepaint all tqchildren widgets +static void tqrepaintAll(TQWidget *w) { - QObjectList *list = w->queryList("QWidget"); - QObjectListIt it(*list); - for (QObject *obj; (obj=it.current()); ++it ) { - static_cast<QWidget*>(obj)->repaint(); + TQObjectList *list = w->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectListIt it(*list); + for (TQObject *obj; (obj=it.current()); ++it ) { + static_cast<TQWidget*>(obj)->tqrepaint(); } delete list; } void -KexiReportForm::drawRect(const QRect& r, int type) +KexiReportForm::drawRect(const TQRect& r, int type) { - QValueList<QRect> l; + TQValueList<TQRect> l; l.append(r); drawRects(l, type); } void -KexiReportForm::drawRects(const QValueList<QRect> &list, int type) +KexiReportForm::drawRects(const TQValueList<TQRect> &list, int type) { - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); if (prev_rect.isValid()) { //redraw prev. selection's rectangle - p.drawPixmap( QPoint(prev_rect.x()-2, prev_rect.y()-2), buffer, QRect(prev_rect.x()-2, prev_rect.y()-2, prev_rect.width()+4, prev_rect.height()+4)); + p.drawPixmap( TQPoint(prev_rect.x()-2, prev_rect.y()-2), buffer, TQRect(prev_rect.x()-2, prev_rect.y()-2, prev_rect.width()+4, prev_rect.height()+4)); } - p.setBrush(QBrush::NoBrush); + p.setBrush(TQBrush::NoBrush); if(type == 1) // selection rect - p.setPen(QPen(white, 1, Qt::DotLine)); + p.setPen(TQPen(white, 1, TQt::DotLine)); else if(type == 2) // insert rect - p.setPen(QPen(white, 2)); + p.setPen(TQPen(white, 2)); p.setRasterOp(XorROP); - prev_rect = QRect(); - QValueList<QRect>::ConstIterator endIt = list.constEnd(); - for(QValueList<QRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) { + prev_rect = TQRect(); + TQValueList<TQRect>::ConstIterator endIt = list.constEnd(); + for(TQValueList<TQRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) { p.drawRect(*it); prev_rect = prev_rect.unite(*it); } @@ -93,58 +93,58 @@ KexiReportForm::drawRects(const QValueList<QRect> &list, int type) void KexiReportForm::initBuffer() { - repaintAll(this); + tqrepaintAll(this); buffer.resize( width(), height() ); - buffer = QPixmap::grabWindow( winId() ); - prev_rect = QRect(); + buffer = TQPixmap::grabWindow( winId() ); + prev_rect = TQRect(); } void KexiReportForm::clearForm() { - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); //redraw entire form surface - p.drawPixmap( QPoint(0,0), buffer, QRect(0,0,buffer.width(), buffer.height()) ); + p.drawPixmap( TQPoint(0,0), buffer, TQRect(0,0,buffer.width(), buffer.height()) ); if (!unclipped) clearWFlags( WPaintUnclipped ); p.end(); - repaintAll(this); + tqrepaintAll(this); } void -KexiReportForm::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &point) +KexiReportForm::highlightWidgets(TQWidget *from, TQWidget *to)//, const TQPoint &point) { - QPoint fromPoint, toPoint; - if(from && from->parentWidget() && (from != this)) - fromPoint = from->parentWidget()->mapTo(this, from->pos()); - if(to && to->parentWidget() && (to != this)) - toPoint = to->parentWidget()->mapTo(this, to->pos()); + TQPoint fromPoint, toPoint; + if(from && from->tqparentWidget() && (from != this)) + fromPoint = from->tqparentWidget()->mapTo(this, from->pos()); + if(to && to->tqparentWidget() && (to != this)) + toPoint = to->tqparentWidget()->mapTo(this, to->pos()); - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); if (prev_rect.isValid()) { //redraw prev. selection's rectangle - p.drawPixmap( QPoint(prev_rect.x(), prev_rect.y()), buffer, QRect(prev_rect.x(), prev_rect.y(), prev_rect.width(), prev_rect.height())); + p.drawPixmap( TQPoint(prev_rect.x(), prev_rect.y()), buffer, TQRect(prev_rect.x(), prev_rect.y(), prev_rect.width(), prev_rect.height())); } - p.setPen( QPen(Qt::red, 2) ); + p.setPen( TQPen(TQt::red, 2) ); if(to) { - QPixmap pix1 = QPixmap::grabWidget(from); - QPixmap pix2 = QPixmap::grabWidget(to); + TQPixmap pix1 = TQPixmap::grabWidget(from); + TQPixmap pix2 = TQPixmap::grabWidget(to); if((from != this) && (to != this)) - p.drawLine( from->parentWidget()->mapTo(this, from->geometry().center()), to->parentWidget()->mapTo(this, to->geometry().center()) ); + p.drawLine( from->tqparentWidget()->mapTo(this, from->tqgeometry().center()), to->tqparentWidget()->mapTo(this, to->tqgeometry().center()) ); p.drawPixmap(fromPoint.x(), fromPoint.y(), pix1); p.drawPixmap(toPoint.x(), toPoint.y(), pix2); @@ -161,7 +161,7 @@ KexiReportForm::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po p.drawRoundRect(fromPoint.x(), fromPoint.y(), from->width(), from->height(), 5, 5); if((to == this) || (from == this)) - prev_rect = QRect(0, 0, buffer.width(), buffer.height()); + prev_rect = TQRect(0, 0, buffer.width(), buffer.height()); else if(to) { prev_rect.setX( (fromPoint.x() < toPoint.x()) ? (fromPoint.x() - 5) : (toPoint.x() - 5) ); @@ -170,18 +170,18 @@ KexiReportForm::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po prev_rect.setBottom( (fromPoint.y() < toPoint.y()) ? (toPoint.y() + to->height() + 10) : (fromPoint.y() + from->height() + 10) ) ; } else - prev_rect = QRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10); + prev_rect = TQRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10); if (!unclipped) clearWFlags( WPaintUnclipped ); p.end(); } -QSize -KexiReportForm::sizeHint() const +TQSize +KexiReportForm::tqsizeHint() const { //todo: find better size (user configured?) - return QSize(400,300); + return TQSize(400,300); } #include "kexireportform.moc" diff --git a/kexi/plugins/reports/kexireportform.h b/kexi/plugins/reports/kexireportform.h index 8b03c2ec..9f13fbc9 100644 --- a/kexi/plugins/reports/kexireportform.h +++ b/kexi/plugins/reports/kexireportform.h @@ -21,40 +21,41 @@ #ifndef KEXIREPORTFORM_H #define KEXIREPORTFORM_H -#include <qwidget.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpixmap.h> #include <formeditor/form.h> //! The report top widget -class KEXIREPORTUTILS_EXPORT KexiReportForm : public QWidget, public KFormDesigner::FormWidget +class KEXIREPORTUTILS_EXPORT KexiReportForm : public TQWidget, public KFormDesigner::FormWidget { Q_OBJECT + TQ_OBJECT public: - KexiReportForm(QWidget *parent, const char *name="kexi_dbform"); + KexiReportForm(TQWidget *tqparent, const char *name="kexi_dbform"); virtual ~KexiReportForm(); - /*QString datasource() const { return m_ds; } + /*TQString datasource() const { return m_ds; } bool navigatorShown() const { return m_nav; } - void setDatasource(const QString &s) { m_ds = s; } + void setDatasource(const TQString &s) { m_ds = s; } void showRecordNavigator(bool s) { m_nav = s; }*/ - virtual void drawRect(const QRect& r, int type); - virtual void drawRects(const QValueList<QRect> &list, int type); + virtual void drawRect(const TQRect& r, int type); + virtual void drawRects(const TQValueList<TQRect> &list, int type); virtual void initBuffer(); virtual void clearForm(); - virtual void highlightWidgets(QWidget *from, QWidget *to/*, const QPoint &p*/); + virtual void highlightWidgets(TQWidget *from, TQWidget *to/*, const TQPoint &p*/); - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; private: - /*QString m_ds; + /*TQString m_ds; bool m_nav; KexiDB::Connection *m_conn;*/ - QPixmap buffer; //!< stores grabbed entire form's area for redraw - QRect prev_rect; //!< previously selected rectangle + TQPixmap buffer; //!< stores grabbed entire form's area for redraw + TQRect prev_rect; //!< previously selected rectangle }; #endif diff --git a/kexi/plugins/reports/kexireportpart.cpp b/kexi/plugins/reports/kexireportpart.cpp index ad83cbf4..6b9c6bc3 100644 --- a/kexi/plugins/reports/kexireportpart.cpp +++ b/kexi/plugins/reports/kexireportpart.cpp @@ -43,8 +43,8 @@ KFormDesigner::WidgetLibrary* KexiReportPart::static_reportsLibrary = 0L; -KexiReportPart::KexiReportPart(QObject *parent, const char *name, const QStringList &l) - : KexiPart::Part(parent, name, l) +KexiReportPart::KexiReportPart(TQObject *tqparent, const char *name, const TQStringList &l) + : KexiPart::Part(tqparent, name, l) { // REGISTERED ID: m_registeredPartID = (int)KexiPart::ReportObjectType; @@ -66,7 +66,7 @@ KexiReportPart::KexiReportPart(QObject *parent, const char *name, const QStringL // Create and store a handle to report' library. Forms will have their own library too. /* @todo add configuration for supported factory groups */ - QStringList supportedFactoryGroups; + TQStringList supportedFactoryGroups; supportedFactoryGroups += "kexi-report"; static_reportsLibrary = KFormDesigner::FormManager::createWidgetLibrary( formManager, supportedFactoryGroups); @@ -101,22 +101,22 @@ KexiReportPart::createTempData(KexiDialogBase* dialog) } KexiViewBase* -KexiReportPart::createView(QWidget *parent, KexiDialogBase* dialog, - KexiPart::Item &item, int, QMap<QString,QString>*) +KexiReportPart::createView(TQWidget *tqparent, KexiDialogBase* dialog, + KexiPart::Item &item, int, TQMap<TQString,TQString>*) { kexipluginsdbg << "KexiReportPart::createView()" << endl; KexiMainWindow *win = dialog->mainWin(); if (!win || !win->project() || !win->project()->dbConnection()) return 0; - KexiReportView *view = new KexiReportView(win, parent, item.name().latin1(), + KexiReportView *view = new KexiReportView(win, tqparent, item.name().latin1(), win->project()->dbConnection() ); return view; } -QString -KexiReportPart::i18nMessage(const QCString& englishMessage, KexiDialogBase* dlg) const +TQString +KexiReportPart::i18nMessage(const TQCString& englishMessage, KexiDialogBase* dlg) const { Q_UNUSED(dlg); if (englishMessage=="Design of object \"%1\" has been modified.") @@ -128,8 +128,8 @@ KexiReportPart::i18nMessage(const QCString& englishMessage, KexiDialogBase* dlg) //--------------- -KexiReportPart::TempData::TempData(QObject* parent) - : KexiDialogTempData(parent) +KexiReportPart::TempData::TempData(TQObject* tqparent) + : KexiDialogTempData(tqparent) { } diff --git a/kexi/plugins/reports/kexireportpart.h b/kexi/plugins/reports/kexireportpart.h index 19731e57..ee93580f 100644 --- a/kexi/plugins/reports/kexireportpart.h +++ b/kexi/plugins/reports/kexireportpart.h @@ -42,9 +42,10 @@ namespace KexiDB class KEXIREPORTUTILS_EXPORT KexiReportPart : public KexiPart::Part { Q_OBJECT + TQ_OBJECT public: - KexiReportPart(QObject *parent, const char *name, const QStringList &); + KexiReportPart(TQObject *tqparent, const char *name, const TQStringList &); virtual ~KexiReportPart(); //! \return a pointer to Reports Widget Library. @@ -52,28 +53,28 @@ class KEXIREPORTUTILS_EXPORT KexiReportPart : public KexiPart::Part // KFormDesigner::FormManager *manager() { return m_manager; } - void generateForm(KexiDB::FieldList *list, QDomDocument &domDoc); + void generateForm(KexiDB::FieldList *list, TQDomDocument &domDoc); class TempData : public KexiDialogTempData { public: - TempData(QObject* parent); + TempData(TQObject* tqparent); ~TempData(); - QGuardedPtr<KFormDesigner::Form> form; - QGuardedPtr<KFormDesigner::Form> previewForm; - QString tempForm; - QPoint scrollViewContentsPos; //!< to preserve contents pos after switching to other view + TQGuardedPtr<KFormDesigner::Form> form; + TQGuardedPtr<KFormDesigner::Form> previewForm; + TQString tempForm; + TQPoint scrollViewContentsPos; //!< to preserve contents pos after switching to other view int resizeMode; //!< form's window's resize mode -one of KexiFormView::ResizeMode items }; - virtual QString i18nMessage(const QCString& englishMessage, + virtual TQString i18nMessage(const TQCString& englishMessage, KexiDialogBase* dlg) const; protected: virtual KexiDialogTempData* createTempData(KexiDialogBase* dialog); - virtual KexiViewBase* createView(QWidget *parent, KexiDialogBase* dialog, - KexiPart::Item &item, int viewMode = Kexi::DataViewMode, QMap<QString,QString>* staticObjectArgs = 0); + virtual KexiViewBase* createView(TQWidget *tqparent, KexiDialogBase* dialog, + KexiPart::Item &item, int viewMode = Kexi::DataViewMode, TQMap<TQString,TQString>* staticObjectArgs = 0); virtual void initPartActions(); virtual void initInstanceActions(); @@ -81,7 +82,7 @@ class KEXIREPORTUTILS_EXPORT KexiReportPart : public KexiPart::Part static KFormDesigner::WidgetLibrary* static_reportsLibrary; private: -// QGuardedPtr<KFormDesigner::FormManager> m_manager; +// TQGuardedPtr<KFormDesigner::FormManager> m_manager; }; #endif diff --git a/kexi/plugins/reports/kexireportview.cpp b/kexi/plugins/reports/kexireportview.cpp index 6b7f46b5..913a493e 100644 --- a/kexi/plugins/reports/kexireportview.cpp +++ b/kexi/plugins/reports/kexireportview.cpp @@ -39,15 +39,15 @@ #define NO_DSWIZARD -KexiReportScrollView::KexiReportScrollView(QWidget *parent, bool preview) - : KexiScrollView(parent, preview) +KexiReportScrollView::KexiReportScrollView(TQWidget *tqparent, bool preview) + : KexiScrollView(tqparent, preview) { if(preview) { setRecordNavigatorVisible(true); recordNavigator()->setLabelText(i18n("Page:")); recordNavigator()->setInsertingButtonVisible(false); } - connect(this, SIGNAL(resizingStarted()), this, SLOT(slotResizingStarted())); + connect(this, TQT_SIGNAL(resizingStarted()), this, TQT_SLOT(slotResizingStarted())); } KexiReportScrollView::~KexiReportScrollView() @@ -61,7 +61,7 @@ KexiReportScrollView::show() //now get resize mode settings for entire form if (m_preview) { - KexiReportView* fv = dynamic_cast<KexiReportView*>(parent()); + KexiReportView* fv = dynamic_cast<KexiReportView*>(tqparent()); int resizeMode = fv ? fv->resizeMode() : KexiReportView::ResizeAuto; if (resizeMode == KexiReportView::ResizeAuto) setResizePolicy(AutoOneFit); @@ -80,12 +80,12 @@ KexiReportScrollView::slotResizingStarted() ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// -KexiReportView::KexiReportView(KexiMainWindow *win, QWidget *parent, const char *name, +KexiReportView::KexiReportView(KexiMainWindow *win, TQWidget *tqparent, const char *name, KexiDB::Connection *conn) - : KexiViewBase(win, parent, name), m_propertySet(0), m_conn(conn) + : KexiViewBase(win, tqparent, name), m_propertySet(0), m_conn(conn) , m_resizeMode(KexiReportView::ResizeDefault) { - QHBoxLayout *l = new QHBoxLayout(this); + TQHBoxLayout *l = new TQHBoxLayout(this); l->setAutoAdd(true); m_scrollView = new KexiReportScrollView(this, viewMode()==Kexi::DataViewMode); @@ -93,7 +93,7 @@ KexiReportView::KexiReportView(KexiMainWindow *win, QWidget *parent, const char // m_scrollView->show(); m_reportform = new KexiReportForm(m_scrollView->viewport(), name/*, conn*/); -// m_reportform->resize(QSize(400, 300)); +// m_reportform->resize(TQSize(400, 300)); m_scrollView->setWidget(m_reportform); m_scrollView->setResizingEnabled(viewMode()!=Kexi::DataViewMode); @@ -102,54 +102,54 @@ KexiReportView::KexiReportView(KexiMainWindow *win, QWidget *parent, const char if (viewMode()==Kexi::DataViewMode) { m_scrollView->viewport()->setPaletteBackgroundColor(m_reportform->palette().active().background()); #if 0 - connect(reportPart()->manager(), SIGNAL(noFormSelected()), SLOT(slotNoFormSelected())); + connect(reportPart()->manager(), TQT_SIGNAL(noFormSelected()), TQT_SLOT(slotNoFormSelected())); #endif } else { - connect(KFormDesigner::FormManager::self(), SIGNAL(propertySetSwitched(KoProperty::Set *, bool)), - this, SLOT(slotPropertySetSwitched(KoProperty::Set *, bool))); - connect(KFormDesigner::FormManager::self(), SIGNAL(dirty(KFormDesigner::Form *, bool)), - this, SLOT(slotDirty(KFormDesigner::Form *, bool))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(propertySetSwitched(KoProperty::Set *, bool)), + this, TQT_SLOT(slotPropertySetSwitched(KoProperty::Set *, bool))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(dirty(KFormDesigner::Form *, bool)), + this, TQT_SLOT(slotDirty(KFormDesigner::Form *, bool))); // action stuff - /*connect(reportPart()->manager(), SIGNAL(widgetSelected(KFormDesigner::Form*, bool)), SLOT(slotWidgetSelected(KFormDesigner::Form*, bool))); - connect(reportPart()->manager(), SIGNAL(formWidgetSelected(KFormDesigner::Form*)), SLOT(slotFormWidgetSelected(KFormDesigner::Form*))); - connect(reportPart()->manager(), SIGNAL(undoEnabled(bool, const QString&)), this, SLOT(setUndoEnabled(bool))); - connect(reportPart()->manager(), SIGNAL(redoEnabled(bool, const QString&)), this, SLOT(setRedoEnabled(bool)));*/ - - plugSharedAction("edit_copy", KFormDesigner::FormManager::self(), SLOT(copyWidget())); - plugSharedAction("edit_cut", KFormDesigner::FormManager::self(), SLOT(cutWidget())); - plugSharedAction("edit_paste", KFormDesigner::FormManager::self(), SLOT(pasteWidget())); - plugSharedAction("edit_delete", KFormDesigner::FormManager::self(), SLOT(deleteWidget())); - plugSharedAction("edit_select_all", KFormDesigner::FormManager::self(), SLOT(selectAll())); - plugSharedAction("reportpart_clear_contents", KFormDesigner::FormManager::self(), SLOT(clearWidgetContent())); - plugSharedAction("edit_undo", KFormDesigner::FormManager::self(), SLOT(undo())); - plugSharedAction("edit_redo", KFormDesigner::FormManager::self(), SLOT(redo())); - - plugSharedAction("reportpart_format_raise", KFormDesigner::FormManager::self(), SLOT(bringWidgetToFront()) ); - plugSharedAction("reportpart_format_lower", KFormDesigner::FormManager::self(), SLOT(sendWidgetToBack()) ); + /*connect(reportPart()->manager(), TQT_SIGNAL(widgetSelected(KFormDesigner::Form*, bool)), TQT_SLOT(slotWidgetSelected(KFormDesigner::Form*, bool))); + connect(reportPart()->manager(), TQT_SIGNAL(formWidgetSelected(KFormDesigner::Form*)), TQT_SLOT(slotFormWidgetSelected(KFormDesigner::Form*))); + connect(reportPart()->manager(), TQT_SIGNAL(undoEnabled(bool, const TQString&)), this, TQT_SLOT(setUndoEnabled(bool))); + connect(reportPart()->manager(), TQT_SIGNAL(redoEnabled(bool, const TQString&)), this, TQT_SLOT(setRedoEnabled(bool)));*/ + + plugSharedAction("edit_copy", KFormDesigner::FormManager::self(), TQT_SLOT(copyWidget())); + plugSharedAction("edit_cut", KFormDesigner::FormManager::self(), TQT_SLOT(cutWidget())); + plugSharedAction("edit_paste", KFormDesigner::FormManager::self(), TQT_SLOT(pasteWidget())); + plugSharedAction("edit_delete", KFormDesigner::FormManager::self(), TQT_SLOT(deleteWidget())); + plugSharedAction("edit_select_all", KFormDesigner::FormManager::self(), TQT_SLOT(selectAll())); + plugSharedAction("reportpart_clear_contents", KFormDesigner::FormManager::self(), TQT_SLOT(clearWidgetContent())); + plugSharedAction("edit_undo", KFormDesigner::FormManager::self(), TQT_SLOT(undo())); + plugSharedAction("edit_redo", KFormDesigner::FormManager::self(), TQT_SLOT(redo())); + + plugSharedAction("reportpart_format_raise", KFormDesigner::FormManager::self(), TQT_SLOT(bringWidgetToFront()) ); + plugSharedAction("reportpart_format_lower", KFormDesigner::FormManager::self(), TQT_SLOT(sendWidgetToBack()) ); plugSharedAction("reportpart_align_menu", KFormDesigner::FormManager::self(), 0 ); - plugSharedAction("reportpart_align_to_left", KFormDesigner::FormManager::self(),SLOT(alignWidgetsToLeft()) ); - plugSharedAction("reportpart_align_to_right", KFormDesigner::FormManager::self(), SLOT(alignWidgetsToRight()) ); - plugSharedAction("reportpart_align_to_top", KFormDesigner::FormManager::self(), SLOT(alignWidgetsToTop()) ); - plugSharedAction("reportpart_align_to_bottom", KFormDesigner::FormManager::self(), SLOT(alignWidgetsToBottom()) ); - plugSharedAction("reportpart_align_to_grid", KFormDesigner::FormManager::self(), SLOT(alignWidgetsToGrid()) ); + plugSharedAction("reportpart_align_to_left", KFormDesigner::FormManager::self(),TQT_SLOT(alignWidgetsToLeft()) ); + plugSharedAction("reportpart_align_to_right", KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToRight()) ); + plugSharedAction("reportpart_align_to_top", KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToTop()) ); + plugSharedAction("reportpart_align_to_bottom", KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToBottom()) ); + plugSharedAction("reportpart_align_to_grid", KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToGrid()) ); plugSharedAction("reportpart_adjust_size_menu", KFormDesigner::FormManager::self(), 0 ); - plugSharedAction("reportpart_adjust_to_fit", KFormDesigner::FormManager::self(), SLOT(adjustWidgetSize()) ); - plugSharedAction("reportpart_adjust_size_grid", KFormDesigner::FormManager::self(), SLOT(adjustSizeToGrid()) ); - plugSharedAction("reportpart_adjust_height_small", KFormDesigner::FormManager::self(), SLOT(adjustHeightToSmall()) ); - plugSharedAction("reportpart_adjust_height_big", KFormDesigner::FormManager::self(), SLOT(adjustHeightToBig()) ); - plugSharedAction("reportpart_adjust_width_small", KFormDesigner::FormManager::self(), SLOT(adjustWidthToSmall()) ); - plugSharedAction("reportpart_adjust_width_big", KFormDesigner::FormManager::self(), SLOT(adjustWidthToBig()) ); + plugSharedAction("reportpart_adjust_to_fit", KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidgetSize()) ); + plugSharedAction("reportpart_adjust_size_grid", KFormDesigner::FormManager::self(), TQT_SLOT(adjustSizeToGrid()) ); + plugSharedAction("reportpart_adjust_height_small", KFormDesigner::FormManager::self(), TQT_SLOT(adjustHeightToSmall()) ); + plugSharedAction("reportpart_adjust_height_big", KFormDesigner::FormManager::self(), TQT_SLOT(adjustHeightToBig()) ); + plugSharedAction("reportpart_adjust_width_small", KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidthToSmall()) ); + plugSharedAction("reportpart_adjust_width_big", KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidthToBig()) ); } initForm(); - connect(this, SIGNAL(focus(bool)), this, SLOT(slotFocus(bool))); + connect(this, TQT_SIGNAL(focus(bool)), this, TQT_SLOT(slotFocus(bool))); /// @todo skip this if ther're no borders -// m_reportform->resize( m_reportform->size()+QSize(m_scrollView->verticalScrollBar()->width(), m_scrollView->horizontalScrollBar()->height()) ); +// m_reportform->resize( m_reportform->size()+TQSize(m_scrollView->verticalScrollBar()->width(), m_scrollView->horizontalScrollBar()->height()) ); } KexiReportView::~KexiReportView() @@ -187,10 +187,10 @@ KexiReportView::initForm() // Show the form wizard if this is a new Form // KexiDB::FieldList *fields = 0; - if(parentDialog()->id() < 0) + if(tqparentDialog()->id() < 0) { #ifndef NO_DSWIZARD - KexiDataSourceWizard *w = new KexiDataSourceWizard(mainWin(), (QWidget*)mainWin(), "datasource_wizard"); + KexiDataSourceWizard *w = new KexiDataSourceWizard(mainWin(), (TQWidget*)mainWin(), "datasource_wizard"); if(!w->exec()) fields = 0; else @@ -202,7 +202,7 @@ KexiReportView::initForm() /* if(fields) { @todo generate a report from a table or a query - QDomDocument dom; + TQDomDocument dom; reportPart()->generateForm(fields, dom); KFormDesigner::FormIO::loadFormFromDom(form(), m_reportform, dom); } @@ -220,7 +220,7 @@ KexiReportView::loadForm() //@todo also load m_resizeMode ! - kexipluginsdbg << "KexiReportForm::loadForm() Loading the form with id : " << parentDialog()->id() << endl; + kexipluginsdbg << "KexiReportForm::loadForm() Loading the form with id : " << tqparentDialog()->id() << endl; // If we are previewing the Form, use the tempData instead of the form stored in the db if(viewMode()==Kexi::DataViewMode && !tempData()->tempForm.isNull() ) { KFormDesigner::FormIO::loadFormFromString(form(), m_reportform, tempData()->tempForm); @@ -228,7 +228,7 @@ KexiReportView::loadForm() } // normal load - QString data; + TQString data; loadDataBlock(data); KFormDesigner::FormIO::loadFormFromString(form(), m_reportform, data); } @@ -249,7 +249,7 @@ KexiReportView::beforeSwitchTo(int mode, bool &dontStore) if (mode!=viewMode() && viewMode()!=Kexi::DataViewMode) { //remember our pos tempData()->scrollViewContentsPos - = QPoint(m_scrollView->contentsX(), m_scrollView->contentsY()); + = TQPoint(m_scrollView->contentsX(), m_scrollView->contentsY()); } // we don't store on db, but in our TempData @@ -322,12 +322,12 @@ tristate KexiReportView::storeData(bool dontAsk) { Q_UNUSED(dontAsk) - kexipluginsdbg << "KexiReportForm::storeData(): " << parentDialog()->partItem()->name() << " [" << parentDialog()->id() << "]" << endl; - QString data; + kexipluginsdbg << "KexiReportForm::storeData(): " << tqparentDialog()->partItem()->name() << " [" << tqparentDialog()->id() << "]" << endl; + TQString data; KFormDesigner::FormIO::saveFormToString(tempData()->form, data); if (!storeDataBlock(data)) return false; - tempData()->tempForm = QString(); + tempData()->tempForm = TQString(); return true; } @@ -428,17 +428,17 @@ KexiReportView::setRedoEnabled(bool enabled) } #endif -QSize -KexiReportView::preferredSizeHint(const QSize& otherSize) +TQSize +KexiReportView::preferredSizeHint(const TQSize& otherSize) { return (m_reportform->size() - +QSize(m_scrollView->verticalScrollBar()->isVisible() ? m_scrollView->verticalScrollBar()->width()*3/2 : 10, + +TQSize(m_scrollView->verticalScrollBar()->isVisible() ? m_scrollView->verticalScrollBar()->width()*3/2 : 10, m_scrollView->horizontalScrollBar()->isVisible() ? m_scrollView->horizontalScrollBar()->height()*3/2 : 10)) .expandedTo( KexiViewBase::preferredSizeHint(otherSize) ); } void -KexiReportView::resizeEvent( QResizeEvent *e ) +KexiReportView::resizeEvent( TQResizeEvent *e ) { if (viewMode()==Kexi::DataViewMode) { m_scrollView->refreshContentsSizeLater( @@ -461,7 +461,7 @@ KexiReportView::show() // if (resizeMode() == KexiFormView::ResizeAuto) if (viewMode()==Kexi::DataViewMode) { if (resizeMode() == ResizeAuto) - m_scrollView->setResizePolicy(QScrollView::AutoOneFit); + m_scrollView->setResizePolicy(TQScrollView::AutoOneFit); } } diff --git a/kexi/plugins/reports/kexireportview.h b/kexi/plugins/reports/kexireportview.h index b600c06d..02b4b48a 100644 --- a/kexi/plugins/reports/kexireportview.h +++ b/kexi/plugins/reports/kexireportview.h @@ -21,8 +21,8 @@ #ifndef KEXIREPORTVIEW_H #define KEXIREPORTVIEW_H -#include <qscrollview.h> -#include <qtimer.h> +#include <tqscrollview.h> +#include <tqtimer.h> #include <kexiviewbase.h> @@ -34,9 +34,10 @@ class KexiReportForm; class KEXIREPORTUTILS_EXPORT KexiReportScrollView : public KexiScrollView { Q_OBJECT + TQ_OBJECT public: - KexiReportScrollView(QWidget *parent, bool preview); + KexiReportScrollView(TQWidget *tqparent, bool preview); virtual ~KexiReportScrollView(); void setForm(KFormDesigner::Form *form) { m_form = form; } @@ -62,6 +63,7 @@ class KEXIREPORTUTILS_EXPORT KexiReportScrollView : public KexiScrollView class KEXIREPORTUTILS_EXPORT KexiReportView : public KexiViewBase { Q_OBJECT + TQ_OBJECT public: enum ResizeMode { @@ -71,12 +73,12 @@ class KEXIREPORTUTILS_EXPORT KexiReportView : public KexiViewBase NoResize = 2 /*! @todo */ }; - KexiReportView(KexiMainWindow *win, QWidget *parent, const char *name, KexiDB::Connection *conn); + KexiReportView(KexiMainWindow *win, TQWidget *tqparent, const char *name, KexiDB::Connection *conn); virtual ~KexiReportView(); KexiDB::Connection* connection() { return m_conn; } - virtual QSize preferredSizeHint(const QSize& otherSize); + virtual TQSize preferredSizeHint(const TQSize& otherSize); int resizeMode() const { return m_resizeMode; } @@ -105,7 +107,7 @@ class KEXIREPORTUTILS_EXPORT KexiReportView : public KexiViewBase virtual tristate storeData(bool dontAsk = false); KexiReportPart::TempData* tempData() const { - return static_cast<KexiReportPart::TempData*>(parentDialog()->tempData()); } + return static_cast<KexiReportPart::TempData*>(tqparentDialog()->tempData()); } KexiReportPart* reportPart() const { return static_cast<KexiReportPart*>(part()); } void disableWidgetActions(); @@ -117,7 +119,7 @@ class KEXIREPORTUTILS_EXPORT KexiReportView : public KexiViewBase void initForm(); void loadForm(); - virtual void resizeEvent ( QResizeEvent * ); + virtual void resizeEvent ( TQResizeEvent * ); private: KexiReportForm *m_reportform; diff --git a/kexi/plugins/reports/reportwidgets.cpp b/kexi/plugins/reports/reportwidgets.cpp index 5437325a..393beaad 100644 --- a/kexi/plugins/reports/reportwidgets.cpp +++ b/kexi/plugins/reports/reportwidgets.cpp @@ -16,7 +16,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> +#include <tqpainter.h> #include <form.h> #include <formIO.h> @@ -28,20 +28,20 @@ #include "kexireportview.h" #include "reportwidgets.h" -Label::Label(const QString &text, QWidget *parent, const char *name) -: QLabel(text, parent, name) +Label::Label(const TQString &text, TQWidget *tqparent, const char *name) +: TQLabel(text, tqparent, name) { setPaletteBackgroundColor(white); } //////////////////////////////////////////////////////////////////// -ReportLine::ReportLine(QWidget *parent, const char *name) -: QWidget(parent, name) +ReportLine::ReportLine(TQWidget *tqparent, const char *name) +: TQWidget(tqparent, name) { - m_lineStyle = (ReportLineStyle)Qt::SolidLine; + m_lineStyle = (ReportLineStyle)TQt::SolidLine; m_lineWidth = 1; - m_capStyle = (CapStyle)Qt::FlatCap; + m_capStyle = (CapStyle)TQt::FlatCap; m_color = paletteForegroundColor(); setPaletteBackgroundColor(white); } @@ -72,14 +72,14 @@ ReportLine::setLineWidth(int width) update(); } -QColor +TQColor ReportLine::color() const { return m_color; } void -ReportLine::setColor(const QColor &color) +ReportLine::setColor(const TQColor &color) { m_color = color; update(); @@ -99,13 +99,13 @@ ReportLine::setCapStyle(CapStyle capStyle) } void -ReportLine::paintEvent (QPaintEvent *ev) +ReportLine::paintEvent (TQPaintEvent *ev) { - QPainter p(this); + TQPainter p(this); if(!ev->erased()) p.eraseRect(0, 0, width(), height()); - QPen pen(m_color, m_lineWidth, (Qt::PenStyle)m_lineStyle); - pen.setCapStyle((Qt::PenCapStyle)m_capStyle); + TQPen pen(m_color, m_lineWidth, (Qt::PenStyle)m_lineStyle); + pen.setCapStyle((TQt::PenCapStyle)m_capStyle); p.setPen(pen); p.drawLine(0, 0, width() -1, height() - 1); } @@ -113,8 +113,8 @@ ReportLine::paintEvent (QPaintEvent *ev) //////////////////////////////////////////////////////////////////// -PicLabel::PicLabel(const QPixmap &pix, QWidget *parent, const char *name) - : QLabel(parent, name) +PicLabel::PicLabel(const TQPixmap &pix, TQWidget *tqparent, const char *name) + : TQLabel(tqparent, name) { setPixmap(pix); setScaledContents(false); @@ -122,52 +122,52 @@ PicLabel::PicLabel(const QPixmap &pix, QWidget *parent, const char *name) } bool -PicLabel::setProperty(const char *name, const QVariant &value) +PicLabel::setProperty(const char *name, const TQVariant &value) { - if(QString(name) == "pixmap") + if(TQString(name) == "pixmap") resize(value.toPixmap().height(), value.toPixmap().width()); - return QLabel::setProperty(name, value); + return TQLabel::setProperty(name, value); } //////////////////////////////////////////////////////////////////// -KexiSubReport::KexiSubReport(QWidget *parent, const char *name) -: QScrollView(parent, name), m_form(0), m_widget(0) +KexiSubReport::KexiSubReport(TQWidget *tqparent, const char *name) +: TQScrollView(tqparent, name), m_form(0), m_widget(0) { - setFrameStyle(QFrame::Plain | QFrame::Box); + setFrameStyle(TQFrame::Plain | TQFrame::Box); viewport()->setPaletteBackgroundColor(white); } void -KexiSubReport::setReportName(const QString &name) +KexiSubReport::setReportName(const TQString &name) { if(name.isEmpty()) return; // we need a KexiReportView* - QWidget *w = parentWidget(); + TQWidget *w = tqparentWidget(); while(w && !w->isA("KexiReportView")) - w = w->parentWidget(); + w = w->tqparentWidget(); KexiReportView *view = (KexiReportView*)w; if(!view) return; // we check if there is a form with this name int id = KexiDB::idForObjectName(*(view->connection()), name, KexiPart::ReportObjectType); - if((id == 0) || (id == view->parentDialog()->id())) // == our form + if((id == 0) || (id == view->tqparentDialog()->id())) // == our form return; // because of recursion when loading // we create the container widget delete m_widget; - m_widget = new QWidget(viewport(), "kexisubreport_widget"); + m_widget = new TQWidget(viewport(), "kexisubreport_widget"); m_widget->show(); addChild(m_widget); m_form = new Form(KexiReportPart::library(), this->name()); m_form->createToplevel(m_widget); // and load the sub form - QString data; - tristate res = view->connection()->loadDataBlock(id, data , QString::null); + TQString data; + tristate res = view->connection()->loadDataBlock(id, data , TQString()); if(res != true) return; diff --git a/kexi/plugins/reports/reportwidgets.h b/kexi/plugins/reports/reportwidgets.h index f8140b0c..9e587556 100644 --- a/kexi/plugins/reports/reportwidgets.h +++ b/kexi/plugins/reports/reportwidgets.h @@ -20,8 +20,8 @@ #ifndef KEXIREPORTWIDGETS_H #define KEXIREPORTWIDGETS_H -#include <qlabel.h> -#include <qscrollview.h> +#include <tqlabel.h> +#include <tqscrollview.h> namespace KFormDesigner { class Form; @@ -31,63 +31,67 @@ namespace KFormDesigner { using KFormDesigner::Form; //! A form embedded as a widget inside other form -class KexiSubReport : public QScrollView +class KexiSubReport : public TQScrollView { Q_OBJECT - Q_PROPERTY(QString reportName READ reportName WRITE setReportName DESIGNABLE true); + TQ_OBJECT + TQ_PROPERTY(TQString reportName READ reportName WRITE setReportName DESIGNABLE true); public: - KexiSubReport(QWidget *parent, const char *name); + KexiSubReport(TQWidget *tqparent, const char *name); ~KexiSubReport() {} //! \return the name of the subreport inside the db - QString reportName() const { return m_reportName; } - void setReportName(const QString &name); + TQString reportName() const { return m_reportName; } + void setReportName(const TQString &name); private: // KFormDesigner::FormManager *m_manager; Form *m_form; - QWidget *m_widget; - QString m_reportName; + TQWidget *m_widget; + TQString m_reportName; }; //! A simple label inside a report -class Label : public QLabel +class Label : public TQLabel { Q_OBJECT + TQ_OBJECT public: - Label(const QString &text, QWidget *parent, const char *name); + Label(const TQString &text, TQWidget *tqparent, const char *name); ~Label() {} }; //! A simple picture label inside a report -class PicLabel : public QLabel +class PicLabel : public TQLabel { Q_OBJECT + TQ_OBJECT public: - PicLabel(const QPixmap &pix, QWidget *parent, const char *name); + PicLabel(const TQPixmap &pix, TQWidget *tqparent, const char *name); ~PicLabel() {} - virtual bool setProperty(const char *name, const QVariant &value); + virtual bool setProperty(const char *name, const TQVariant &value); }; //! A line -class ReportLine : public QWidget +class ReportLine : public TQWidget { Q_OBJECT - Q_PROPERTY(ReportLineStyle lineStyle READ lineStyle WRITE setLineStyle) - Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth) - Q_PROPERTY(QColor color READ color WRITE setColor) - Q_PROPERTY(CapStyle capStyle READ capStyle WRITE setCapStyle) + TQ_OBJECT + TQ_PROPERTY(ReportLineStyle lineStyle READ lineStyle WRITE setLineStyle) + TQ_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth) + TQ_PROPERTY(TQColor color READ color WRITE setColor) + TQ_PROPERTY(CapStyle capStyle READ capStyle WRITE setCapStyle) public: - enum ReportLineStyle { NoLine = Qt::NoPen, Solid = Qt::SolidLine, Dash = Qt::DashLine, Dot = Qt::DotLine, - DashDot = Qt::DashDotLine, DashDotDot = Qt::DashDotDotLine }; - enum CapStyle { Flat = Qt::FlatCap, Square = Qt::SquareCap, Round = Qt::RoundCap }; + enum ReportLineStyle { NoLine = TQt::NoPen, Solid = TQt::SolidLine, Dash = TQt::DashLine, Dot = TQt::DotLine, + DashDot = TQt::DashDotLine, DashDotDot = TQt::DashDotDotLine }; + enum CapStyle { Flat = TQt::FlatCap, Square = TQt::SquareCap, Round = TQt::RoundCap }; - ReportLine(QWidget *parent, const char *name); + ReportLine(TQWidget *tqparent, const char *name); ~ReportLine(){;} ReportLineStyle lineStyle() const; @@ -96,20 +100,20 @@ class ReportLine : public QWidget int lineWidth() const; void setLineWidth(int width); - QColor color() const; - void setColor(const QColor &color); + TQColor color() const; + void setColor(const TQColor &color); CapStyle capStyle() const; void setCapStyle(CapStyle capStyle); protected: - virtual void paintEvent (QPaintEvent *ev); + virtual void paintEvent (TQPaintEvent *ev); private: ReportLineStyle m_lineStyle; int m_lineWidth; CapStyle m_capStyle; - QColor m_color; + TQColor m_color; }; |