diff options
Diffstat (limited to 'kiconedit')
-rw-r--r-- | kiconedit/kcolorgrid.cpp | 26 | ||||
-rw-r--r-- | kiconedit/kcolorgrid.h | 9 | ||||
-rw-r--r-- | kiconedit/kicon.cpp | 32 | ||||
-rw-r--r-- | kiconedit/kicon.h | 5 | ||||
-rw-r--r-- | kiconedit/kiconcolors.cpp | 12 | ||||
-rw-r--r-- | kiconedit/kiconcolors.h | 9 | ||||
-rw-r--r-- | kiconedit/kiconconfig.cpp | 46 | ||||
-rw-r--r-- | kiconedit/kiconconfig.h | 17 | ||||
-rw-r--r-- | kiconedit/kiconedit.cpp | 94 | ||||
-rw-r--r-- | kiconedit/kiconedit.h | 3 | ||||
-rw-r--r-- | kiconedit/kiconeditslots.cpp | 18 | ||||
-rw-r--r-- | kiconedit/kicongrid.cpp | 188 | ||||
-rw-r--r-- | kiconedit/kicongrid.h | 12 | ||||
-rw-r--r-- | kiconedit/knew.cpp | 18 | ||||
-rw-r--r-- | kiconedit/knew.h | 16 | ||||
-rw-r--r-- | kiconedit/kresize.cpp | 16 | ||||
-rw-r--r-- | kiconedit/kresize.h | 8 | ||||
-rw-r--r-- | kiconedit/palettetoolbar.cpp | 54 | ||||
-rw-r--r-- | kiconedit/palettetoolbar.h | 5 | ||||
-rw-r--r-- | kiconedit/properties.h | 2 |
20 files changed, 305 insertions, 285 deletions
diff --git a/kiconedit/kcolorgrid.cpp b/kiconedit/kcolorgrid.cpp index 35b0dfaa..e08529e1 100644 --- a/kiconedit/kcolorgrid.cpp +++ b/kiconedit/kcolorgrid.cpp @@ -69,8 +69,8 @@ uint KColorArray::closestMatch(uint color) return c|OPAQUE_MASK; } -KColorGrid::KColorGrid(TQWidget *parent, const char *name, int space) - : TQWidget(parent, name, Qt::WResizeNoErase|Qt::WRepaintNoErase) +KColorGrid::KColorGrid(TQWidget *tqparent, const char *name, int space) + : TQWidget(tqparent, name, TQt::WResizeNoErase|TQt::WRepaintNoErase) { //kdDebug(4640) << "KColorGrid - constructor" << endl; s = space; @@ -163,7 +163,7 @@ void KColorGrid::resizeEvent(TQResizeEvent *) } */ -TQSize KColorGrid::sizeHint() const +TQSize KColorGrid::tqsizeHint() const { return TQSize(totalwidth, totalheight); } @@ -203,7 +203,7 @@ void KColorGrid::setNumRows(int n) rows = n; gridcolors.resize(n*numCols()); - //QTableView::setNumRows(n); + //TQTableView::setNumRows(n); totalheight = (n * cellsize) + 1; resize(totalwidth, totalheight); //kdDebug(4640) << "setNumRows() - gridcolors: " << gridcolors.size() << " size: " << numCols()*numRows() << endl; @@ -269,9 +269,9 @@ void KColorGrid::setColor( int colNum, uint col, bool update ) return; //kdDebug(4640) << "KColorGrid::setColor - before adding" << endl; - if(!numcolors.contains(col)) + if(!numcolors.tqcontains(col)) { - //kdDebug(4640) << "KColorGrid::setColor() - adding " << // col << " - " << qRed(col) << " " << qGreen(col) << " " << qBlue(col) << endl; + //kdDebug(4640) << "KColorGrid::setColor() - adding " << // col << " - " << tqRed(col) << " " << tqGreen(col) << " " << tqBlue(col) << endl; numcolors.append(col); //kdDebug(4640) << "KColorGrid::setColor() - adding done " << numcolors.size()-1 << endl; //numcolors++; @@ -279,12 +279,12 @@ void KColorGrid::setColor( int colNum, uint col, bool update ) } //kdDebug(4640) << "KColorGrid::setColor - before removing" << endl; - if(!gridcolors.contains(oldcolor)) + if(!gridcolors.tqcontains(oldcolor)) { - int idx = numcolors.find(oldcolor); + int idx = numcolors.tqfind(oldcolor); if(idx != -1) { - //kdDebug(4640) << "KColorGrid::setColor() - removing " << // oldcolor << " - " << qRed(oldcolor) << " " << qGreen(oldcolor) << " " << qBlue(oldcolor) << endl; + //kdDebug(4640) << "KColorGrid::setColor() - removing " << // oldcolor << " - " << tqRed(oldcolor) << " " << tqGreen(oldcolor) << " " << tqBlue(oldcolor) << endl; numcolors.remove(idx); //kdDebug(4640) << "KColorGrid::setColor() - removing done" << endl; emit colorschanged(numcolors.size(), numcolors.data()); @@ -293,14 +293,14 @@ void KColorGrid::setColor( int colNum, uint col, bool update ) } //kdDebug(4640) << "KColorGrid::setColor - before updateCell" << endl; - repaint((colNum%numCols())*cellsize,(colNum/numCols())*cellsize, cellsize, cellsize); + tqrepaint((colNum%numCols())*cellsize,(colNum/numCols())*cellsize, cellsize, cellsize); //updateCell( colNum/numCols(), colNum%numCols(), false ); //kdDebug(4640) << "KColorGrid::setColor - after updateCell" << endl; } void KColorGrid::updateCell( int row, int col, bool ) { - //kdDebug(4640) << "updateCell - before repaint" << endl; + //kdDebug(4640) << "updateCell - before tqrepaint" << endl; TQWMatrix matrix; TQPainter p; p.begin( this ); @@ -317,7 +317,7 @@ void KColorGrid::updateColors() for(int i = 0; i < (int)gridcolors.size(); i++) { uint col = gridcolors.at(i); - if(!numcolors.contains(col)) + if(!numcolors.tqcontains(col)) numcolors.append(col); } emit colorschanged(numcolors.size(), numcolors.data()); @@ -330,6 +330,6 @@ void KColorGrid::setCellSize( int s ) totalheight = (numRows() * s) + 1; resize(totalwidth, totalheight); if ( isVisible() ) - repaint(viewRect(), false); + tqrepaint(viewRect(), false); } #include "kcolorgrid.moc" diff --git a/kiconedit/kcolorgrid.h b/kiconedit/kcolorgrid.h index 76091b45..00a3d478 100644 --- a/kiconedit/kcolorgrid.h +++ b/kiconedit/kcolorgrid.h @@ -37,12 +37,13 @@ public: uint closestMatch(uint); }; -class KColorGrid : public QWidget +class KColorGrid : public TQWidget { private: Q_OBJECT + TQ_OBJECT public: - KColorGrid( TQWidget * parent = 0, const char *name = 0, int spacing = 0); + KColorGrid( TQWidget * tqparent = 0, const char *name = 0, int spacing = 0); virtual ~KColorGrid() {}; enum GridState { Plain, Shaded }; @@ -55,7 +56,7 @@ public: bool hasGrid() { return hasgrid; } uint numColors() { return numcolors.size(); } uint colors( uint *c ) { c = numcolors.data(); return numcolors.size(); } - bool contains(uint c) { return numcolors.contains(c); } + bool tqcontains(uint c) { return numcolors.tqcontains(c); } uint colorAt(int idx) { return gridcolors.at(idx); } uint *data() {return numcolors.data(); } void fill(uint color); @@ -64,7 +65,7 @@ public: virtual void setCellSize( int s ); virtual int cellSize() { return cellsize; } - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; void setSize(const TQSize s) { setNumRows(s.height()); setNumCols(s.width()); } diff --git a/kiconedit/kicon.cpp b/kiconedit/kicon.cpp index 9da72c9b..f1f31590 100644 --- a/kiconedit/kicon.cpp +++ b/kiconedit/kicon.cpp @@ -32,8 +32,8 @@ #include "kicon.h" #include "utils.h" -KIconEditIcon::KIconEditIcon(TQObject *parent, const TQImage *img, KURL url) - : TQObject(parent) +KIconEditIcon::KIconEditIcon(TQObject *tqparent, const TQImage *img, KURL url) + : TQObject(tqparent) { f = 0; _lastdir = "/"; @@ -70,8 +70,8 @@ bool KIconEditIcon::open(const TQImage *image, KURL url) if(!url.isValid()) // Giving up { - TQString msg = i18n("The URL: %1 \nseems to be malformed.\n").arg(url.url()); - KMessageBox::sorry((TQWidget*)parent(), msg); + TQString msg = i18n("The URL: %1 \nseems to be malformed.\n").tqarg(url.url()); + KMessageBox::sorry((TQWidget*)tqparent(), msg); return false; } } @@ -84,10 +84,10 @@ bool KIconEditIcon::open(const TQImage *image, KURL url) } else { - if(!KIO::NetAccess::download( url, filename, (TQWidget*)parent() )) + if(!KIO::NetAccess::download( url, filename, (TQWidget*)tqparent() )) { - TQString msg = i18n("There was an error loading:\n%1\n").arg(url.prettyURL()); - KMessageBox::error((TQWidget*)parent(), msg); + TQString msg = i18n("There was an error loading:\n%1\n").tqarg(url.prettyURL()); + KMessageBox::error((TQWidget*)tqparent(), msg); return false; } } @@ -101,8 +101,8 @@ bool KIconEditIcon::open(const TQImage *image, KURL url) if(!loadedOk) { - TQString msg = i18n("There was an error loading:\n%1\n").arg(url.prettyURL()); - KMessageBox::error((TQWidget*)parent(), msg); + TQString msg = i18n("There was an error loading:\n%1\n").tqarg(url.prettyURL()); + KMessageBox::error((TQWidget*)tqparent(), msg); } else { @@ -152,10 +152,10 @@ bool KIconEditIcon::promptForFile(const TQImage *img) "*.ico|Icon files (*.ico)\n"); - KURL url = KFileDialog::getOpenURL( TQString::null, filter ); + KURL url = KFileDialog::getOpenURL( TQString(), filter ); */ bool loaded = false; - KURL url = KFileDialog::getImageOpenURL( TQString::null, static_cast<TQWidget *>(parent()) ); + KURL url = KFileDialog::getImageOpenURL( TQString(), TQT_TQWIDGET(tqparent()) ); if( !url.isEmpty() ) { @@ -174,7 +174,7 @@ bool KIconEditIcon::saveAs(const TQImage *image) TQString file; //Get list of file types.. - KFileDialog *dialog=new KFileDialog(TQString::null, TQString::null, static_cast<TQWidget *>(parent()), "file dialog", true); + KFileDialog *dialog=new KFileDialog(TQString(), TQString(), TQT_TQWIDGET(tqparent()), "file dialog", true); dialog->setCaption( i18n("Save Icon As") ); dialog->setKeepLocation( true ); dialog->setMimeFilter( KImageIO::mimeTypes(KImageIO::Writing), "image/png" ); @@ -206,9 +206,9 @@ bool KIconEditIcon::saveAs(const TQImage *image) if(TQFile::exists(file)) { - int r=KMessageBox::warningContinueCancel(static_cast<TQWidget *>(parent()), + int r=KMessageBox::warningContinueCancel(TQT_TQWIDGET(tqparent()), i18n( "A file named \"%1\" already exists. " - "Overwrite it?" ).arg(file), + "Overwrite it?" ).tqarg(file), i18n( "Overwrite File?" ), i18n( "&Overwrite" ) ); @@ -265,8 +265,8 @@ bool KIconEditIcon::save(const TQImage *image, const TQString &_filename) } else { - TQString msg = i18n("There was an error saving:\n%1\n").arg(str); - KMessageBox::error((TQWidget*)parent(), msg); + TQString msg = i18n("There was an error saving:\n%1\n").tqarg(str); + KMessageBox::error((TQWidget*)tqparent(), msg); kdDebug(4640) << "KIconEditIcon::save - " << msg << endl; } diff --git a/kiconedit/kicon.h b/kiconedit/kicon.h index d808995e..f38e4cca 100644 --- a/kiconedit/kicon.h +++ b/kiconedit/kicon.h @@ -43,9 +43,10 @@ class TQImage; -class KIconEditIcon : public QObject +class KIconEditIcon : public TQObject { Q_OBJECT + TQ_OBJECT public: KIconEditIcon(TQObject*, const TQImage*, KURL url = KURL() ); ~KIconEditIcon(); @@ -57,7 +58,7 @@ public: public slots: bool open(const TQImage*, KURL url = KURL()); bool promptForFile(const TQImage*); - bool save(const TQImage*, const TQString &filename=TQString::null); + bool save(const TQImage*, const TQString &filename=TQString()); bool saveAs(const TQImage*); signals: diff --git a/kiconedit/kiconcolors.cpp b/kiconedit/kiconcolors.cpp index d3046ad4..c2042432 100644 --- a/kiconedit/kiconcolors.cpp +++ b/kiconedit/kiconcolors.cpp @@ -25,7 +25,7 @@ #include "kiconcolors.h" -KDrawColors::KDrawColors(TQWidget *parent) : KColorGrid(parent, 0, 3) +KDrawColors::KDrawColors(TQWidget *tqparent) : KColorGrid(tqparent, 0, 3) { kdDebug(4640) << "KDrawColors - constructor" << endl; setCellSize(17); @@ -43,7 +43,7 @@ void KDrawColors::paintCell( TQPainter *painter, int row, int col ) int d = spacing(); qDrawShadePanel( painter, d, d, cellSize()-d, cellSize()-d, - colorGroup(), true, 1, &brush); + tqcolorGroup(), true, 1, &brush); if ( row * numCols() + col == selected) painter->drawWinFocusRect( d+1, d+1, cellSize()-(2*d)+1, cellSize()-(2*d)+1 ); } @@ -65,7 +65,7 @@ void KDrawColors::mouseReleaseEvent( TQMouseEvent *e ) emit newColor(colorAt(cell)|OPAQUE_MASK); } -KSysColors::KSysColors(TQWidget *parent) : KDrawColors(parent) +KSysColors::KSysColors(TQWidget *tqparent) : KDrawColors(tqparent) { kdDebug(4640) << "KSysColors - constructor" << endl; @@ -85,7 +85,7 @@ KSysColors::KSysColors(TQWidget *parent) : KDrawColors(parent) kdDebug(4640) << "KSysColors - constructor - done" << endl; } -KCustomColors::KCustomColors(TQWidget *parent) : KDrawColors(parent) +KCustomColors::KCustomColors(TQWidget *tqparent) : KDrawColors(tqparent) { kdDebug(4640) << "KCustomColors - constructor" << endl; setNumRows(3); @@ -119,7 +119,7 @@ void KCustomColors::mouseDoubleClickEvent(TQMouseEvent *e) void KCustomColors::addColor(uint c) { - if(!contains(c)) + if(!tqcontains(c)) { int f = getFreeCell(); if(f != -1) @@ -130,7 +130,7 @@ void KCustomColors::addColor(uint c) kdDebug(4640) << "KCustomColors::addColor: Not a valid color: " << c << endl; return; } - //kdDebug(4640) << "KCustomColors::addColor: Adding color: " << c << " - " << qRed(c) << " " << qGreen(c) << " " << qBlue(c) << endl; + //kdDebug(4640) << "KCustomColors::addColor: Adding color: " << c << " - " << tqRed(c) << " " << tqGreen(c) << " " << tqBlue(c) << endl; setColor(f, c); freecells[f] = false; } diff --git a/kiconedit/kiconcolors.h b/kiconedit/kiconcolors.h index 71d8b240..90f07d09 100644 --- a/kiconedit/kiconcolors.h +++ b/kiconedit/kiconcolors.h @@ -31,8 +31,9 @@ class KDrawColors : public KColorGrid { Q_OBJECT + TQ_OBJECT public: - KDrawColors(TQWidget *parent); + KDrawColors(TQWidget *tqparent); //bool hasColor(uint); @@ -49,8 +50,9 @@ protected: class KCustomColors : public KDrawColors { Q_OBJECT + TQ_OBJECT public: - KCustomColors(TQWidget *parent); + KCustomColors(TQWidget *tqparent); ~KCustomColors(); void addColor(uint); @@ -69,9 +71,10 @@ protected: class KSysColors : public KDrawColors { Q_OBJECT + TQ_OBJECT public: - KSysColors(TQWidget *parent); + KSysColors(TQWidget *tqparent); }; diff --git a/kiconedit/kiconconfig.cpp b/kiconedit/kiconconfig.cpp index d4621a0b..e0e223a5 100644 --- a/kiconedit/kiconconfig.cpp +++ b/kiconedit/kiconconfig.cpp @@ -49,20 +49,20 @@ static inline TQPixmap loadIcon( const char * name ) { return KGlobal::instance()->iconLoader() - ->loadIcon( TQString::fromLatin1(name), KIcon::NoGroup, KIcon::SizeMedium ); + ->loadIcon( TQString::tqfromLatin1(name), KIcon::NoGroup, KIcon::SizeMedium ); } -KTemplateEditDlg::KTemplateEditDlg(TQWidget *parent) - : KDialogBase(parent, "KTemplateEditDlg", true, i18n( "Icon Template" ), +KTemplateEditDlg::KTemplateEditDlg(TQWidget *tqparent) + : KDialogBase(tqparent, "KTemplateEditDlg", true, i18n( "Icon Template" ), Ok|Cancel ) { TQFrame *frame = makeMainWidget(); TQVBoxLayout *ml = new TQVBoxLayout(frame); TQGroupBox *grp = new TQGroupBox(i18n("Template"), frame); grp->setColumnLayout(0, Qt::Vertical); - grp->layout()->setSpacing(spacingHint()); - grp->layout()->setMargin(marginHint()); - TQGridLayout *l = new TQGridLayout(grp->layout()); + grp->tqlayout()->setSpacing(spacingHint()); + grp->tqlayout()->setMargin(marginHint()); + TQGridLayout *l = new TQGridLayout(grp->tqlayout()); ln_name = new TQLineEdit( grp ); connect( ln_name, TQT_SIGNAL( textChanged( const TQString & ) ), @@ -112,7 +112,7 @@ TQString KTemplateEditDlg::path() return ln_path->url(); } -KTemplateConfig::KTemplateConfig(TQWidget *parent) : TQWidget(parent) +KTemplateConfig::KTemplateConfig(TQWidget *tqparent) : TQWidget(tqparent) { kdDebug(4640) << "KTemplateConfig constructor" << endl; @@ -130,7 +130,7 @@ KTemplateConfig::KTemplateConfig(TQWidget *parent) : TQWidget(parent) TQVBoxLayout* ml = new TQVBoxLayout( this ); ml->addWidget( grp ); - TQVBoxLayout* l = new TQVBoxLayout( grp->layout(), KDialog::spacingHint() ); + TQVBoxLayout* l = new TQVBoxLayout( grp->tqlayout(), KDialog::spacingHint() ); l->addWidget( templates ); for( unsigned int i = 0; i < KIconTemplateContainer::self()->count(); i++ ) @@ -151,7 +151,7 @@ KTemplateConfig::KTemplateConfig(TQWidget *parent) : TQWidget(parent) bbox->addStretch( 1 ); - bbox->layout(); + bbox->tqlayout(); l->addWidget( bbox ); } @@ -224,8 +224,8 @@ void KTemplateConfig::edit() } } -KBackgroundConfig::KBackgroundConfig( TQWidget* parent ) - : TQWidget( parent ) +KBackgroundConfig::KBackgroundConfig( TQWidget* tqparent ) + : TQWidget( tqparent ) { kdDebug(4640) << "KBackgroundConfig - constructor" << endl; @@ -246,11 +246,11 @@ KBackgroundConfig::KBackgroundConfig( TQWidget* parent ) TQGroupBox *grp1 = new TQGroupBox( i18n( "Select Background" ), this ); grp1->setColumnLayout(0, Qt::Vertical ); - grp1->layout()->setSpacing( KDialog::spacingHint() ); - grp1->layout()->setMargin( KDialog::marginHint() ); + grp1->tqlayout()->setSpacing( KDialog::spacingHint() ); + grp1->tqlayout()->setMargin( KDialog::marginHint() ); mainLayout->addWidget( grp1 ); - TQGridLayout *grp1Layout = new TQGridLayout( grp1->layout(), 3, 2 ); + TQGridLayout *grp1Layout = new TQGridLayout( grp1->tqlayout(), 3, 2 ); TQButtonGroup* btngrp = new TQButtonGroup( grp1 ); btngrp->setExclusive( true ); @@ -373,7 +373,7 @@ void KBackgroundConfig::selectPixmap() } } -KMiscConfig::KMiscConfig(TQWidget *parent) : TQWidget(parent) +KMiscConfig::KMiscConfig(TQWidget *tqparent) : TQWidget(tqparent) { kdDebug(4640) << "KMiscConfig - constructor" << endl; @@ -524,32 +524,32 @@ void KMiscConfig::slotTransparencyDisplayType(int id) } } -KIconConfig::KIconConfig(TQWidget *parent) +KIconConfig::KIconConfig(TQWidget *tqparent) : KDialogBase(KDialogBase::IconList, i18n("Configure"), KDialogBase::Help | KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel, KDialogBase::Ok, - parent, "configDialog", true, true) + tqparent, "configDialog", true, true) { - setHelp(TQString::null); + setHelp(TQString()); //KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); connect(this, TQT_SIGNAL(finished()), this, TQT_SLOT(finis())); - TQVBox* page = addVBoxPage(i18n("Icon Templates"), TQString::null, loadIcon("icons")); + TQVBox* page = addVBoxPage(i18n("Icon Templates"), TQString(), loadIcon("icons")); temps = new KTemplateConfig(page); - page = addVBoxPage(i18n("Background"), TQString::null, loadIcon("background")); + page = addVBoxPage(i18n("Background"), TQString(), loadIcon("background")); backs = new KBackgroundConfig(page); - page = addVBoxPage(i18n("Icon Grid"), TQString::null, loadIcon("kiconedit")); + page = addVBoxPage(i18n("Icon Grid"), TQString(), loadIcon("kiconedit")); misc = new KMiscConfig(page); TQSize min(300, 400); - if (300 < sizeHint().width()) { min.setWidth(sizeHint().width()); } - if (400 < sizeHint().height()) { min.setHeight(sizeHint().height()); } + if (300 < tqsizeHint().width()) { min.setWidth(tqsizeHint().width()); } + if (400 < tqsizeHint().height()) { min.setHeight(tqsizeHint().height()); } resize(min); } diff --git a/kiconedit/kiconconfig.h b/kiconedit/kiconconfig.h index be1450d3..df143c54 100644 --- a/kiconedit/kiconconfig.h +++ b/kiconedit/kiconconfig.h @@ -41,6 +41,7 @@ class TQComboBox; class KTemplateEditDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: KTemplateEditDlg(TQWidget *); ~KTemplateEditDlg() {}; @@ -58,9 +59,10 @@ protected: KURLRequester *ln_path; }; -class KTemplateConfig : public QWidget +class KTemplateConfig : public TQWidget { Q_OBJECT + TQ_OBJECT public: KTemplateConfig(TQWidget*); ~KTemplateConfig(); @@ -78,11 +80,12 @@ protected: TQPushButton *btadd, *btedit, *btremove; }; -class KBackgroundConfig : public QWidget +class KBackgroundConfig : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KBackgroundConfig(TQWidget *parent); + KBackgroundConfig(TQWidget *tqparent); ~KBackgroundConfig(); public slots: @@ -104,11 +107,12 @@ protected: TQLabel *lb_ex; }; -class KMiscConfig : public QWidget +class KMiscConfig : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KMiscConfig(TQWidget *parent); + KMiscConfig(TQWidget *tqparent); ~KMiscConfig(); public slots: @@ -133,10 +137,11 @@ protected: class KIconConfig : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KIconConfig(TQWidget *parent); + KIconConfig(TQWidget *tqparent); ~KIconConfig(); protected slots: diff --git a/kiconedit/kiconedit.cpp b/kiconedit/kiconedit.cpp index 74325458..f6a6c335 100644 --- a/kiconedit/kiconedit.cpp +++ b/kiconedit/kiconedit.cpp @@ -64,7 +64,7 @@ void KIconEdit::init() gridview = new KGridView(&img, history, this); grid = gridview->grid(); - icon = new KIconEditIcon(this, &grid->image()); + icon = new KIconEditIcon(TQT_TQOBJECT(this), &grid->image()); setAcceptDrops(true); @@ -146,7 +146,7 @@ void KIconEdit::init() updateAccels(); show(); - moveDockWindow( m_paletteToolBar, Qt::DockRight, true, 0 ); + moveDockWindow( m_paletteToolBar, TQt::DockRight, true, 0 ); } KIconEdit::~KIconEdit() @@ -165,7 +165,7 @@ bool KIconEdit::queryClose() if (grid->isModified()) { int r = KMessageBox::warningYesNoCancel(this, - i18n("The current file has been modified.\nDo you want to save it?"), TQString::null, KStdGuiItem::save(), KStdGuiItem::discard()); + i18n("The current file has been modified.\nDo you want to save it?"), TQString(), KStdGuiItem::save(), KStdGuiItem::discard()); switch(r) { @@ -222,10 +222,10 @@ void KIconEdit::writeConfig() saveMainWindowSettings( config, "MainWindowSettings" ); } -TQSize KIconEdit::sizeHint() const +TQSize KIconEdit::tqsizeHint() const { if(gridview) - return gridview->sizeHint(); + return gridview->tqsizeHint(); else return TQSize(-1, -1); } @@ -240,43 +240,43 @@ void KIconEdit::setupActions() // File Menu action = new KAction(i18n("New &Window"), "window_new", cut, - this, TQT_SLOT(slotNewWin()), actionCollection(), "file_new_window"); + TQT_TQOBJECT(this), TQT_SLOT(slotNewWin()), actionCollection(), "file_new_window"); action->setWhatsThis(i18n("New window\n\nOpens a new icon editor window.")); - action = KStdAction::openNew(this, TQT_SLOT(slotNew()), actionCollection()); + action = KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(slotNew()), actionCollection()); action->setWhatsThis(i18n("New\n\nCreate a new icon, either from a" " template or by specifying the size")); - action = KStdAction::open(this, TQT_SLOT(slotOpen()), actionCollection()); + action = KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(slotOpen()), actionCollection()); action->setWhatsThis(i18n("Open\n\nOpen an existing icon")); - m_actRecent = KStdAction::openRecent(this, + m_actRecent = KStdAction::openRecent(TQT_TQOBJECT(this), TQT_SLOT(slotOpenRecent(const KURL&)), actionCollection()); m_actRecent->setMaxItems(15); // FIXME should be configurable! m_actRecent->loadEntries(kapp->config()); - action = KStdAction::save(this, TQT_SLOT(slotSave()), actionCollection()); + action = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotSave()), actionCollection()); action->setWhatsThis(i18n("Save\n\nSave the current icon")); - KStdAction::saveAs(this, TQT_SLOT(slotSaveAs()), actionCollection()); + KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(slotSaveAs()), actionCollection()); - action = KStdAction::print(this, TQT_SLOT(slotPrint()), actionCollection()); + action = KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(slotPrint()), actionCollection()); action->setWhatsThis(i18n("Print\n\nOpens a print dialog to let you print" " the current icon.")); - KStdAction::close(this, TQT_SLOT(slotClose()), actionCollection()); + KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(slotClose()), actionCollection()); // Edit Menu - m_actCut = KStdAction::cut(this, TQT_SLOT(slotCut()), actionCollection()); + m_actCut = KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(slotCut()), actionCollection()); m_actCut->setWhatsThis(i18n("Cut\n\nCut the current selection out of the" " icon.\n\n(Tip: You can make both rectangular and circular selections)")); - m_actCopy = KStdAction::copy(this, TQT_SLOT(slotCopy()), actionCollection()); + m_actCopy = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(slotCopy()), actionCollection()); m_actCopy->setWhatsThis(i18n("Copy\n\nCopy the current selection out of the" " icon.\n\n(Tip: You can make both rectangular and circular selections)")); - m_actPaste = KStdAction::paste(this, TQT_SLOT(slotPaste()), actionCollection()); + m_actPaste = KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(slotPaste()), actionCollection()); m_actPaste->setWhatsThis(i18n("Paste\n\n" "Paste the contents of the clipboard into the current icon.\n\n" "If the contents are larger than the current icon you can paste them" @@ -284,29 +284,29 @@ void KIconEdit::setupActions() "(Tip: Select \"Paste transparent pixels\" in the configuration dialog" " if you also want to paste transparency.)")); - m_actPasteNew = new KAction( i18n( "Paste as &New" ), cut, grid, + m_actPasteNew = new KAction( i18n( "Paste as &New" ), cut, TQT_TQOBJECT(grid), TQT_SLOT( editPasteAsNew() ), actionCollection(), "edit_paste_as_new" ); - KStdAction::clear(this, TQT_SLOT(slotClear()), actionCollection()); - KStdAction::selectAll(this, TQT_SLOT(slotSelectAll()), actionCollection()); + KStdAction::clear(TQT_TQOBJECT(this), TQT_SLOT(slotClear()), actionCollection()); + KStdAction::selectAll(TQT_TQOBJECT(this), TQT_SLOT(slotSelectAll()), actionCollection()); action = new KAction(i18n("Resi&ze..."), "transform", cut, - grid, TQT_SLOT(editResize()), actionCollection(), "edit_resize"); + TQT_TQOBJECT(grid), TQT_SLOT(editResize()), actionCollection(), "edit_resize"); action->setWhatsThis(i18n("Resize\n\nSmoothly resizes the icon while" " trying to preserve the contents")); action = new KAction(i18n("&GrayScale"), "grayscale", cut, - grid, TQT_SLOT(grayScale()), actionCollection(), "edit_grayscale"); + TQT_TQOBJECT(grid), TQT_SLOT(grayScale()), actionCollection(), "edit_grayscale"); action->setWhatsThis(i18n("Gray scale\n\nGray scale the current icon.\n" "(Warning: The result is likely to contain colors not in the icon" " palette")); // View Menu - m_actZoomIn = KStdAction::zoomIn(this, TQT_SLOT(slotZoomIn()), + m_actZoomIn = KStdAction::zoomIn(TQT_TQOBJECT(this), TQT_SLOT(slotZoomIn()), actionCollection()); m_actZoomIn->setWhatsThis(i18n("Zoom in\n\nZoom in by one.")); - m_actZoomOut = KStdAction::zoomOut(this, TQT_SLOT(slotZoomOut()), + m_actZoomOut = KStdAction::zoomOut(TQT_TQOBJECT(this), TQT_SLOT(slotZoomOut()), actionCollection()); m_actZoomOut->setWhatsThis(i18n("Zoom out\n\nZoom out by one.")); @@ -314,26 +314,26 @@ void KIconEdit::setupActions() actionCollection(), "view_zoom" ); // xgettext:no-c-format - action = new KAction( i18n( "100%" ), cut, this, TQT_SLOT( slotZoom1() ), + action = new KAction( i18n( "100%" ), cut, TQT_TQOBJECT(this), TQT_SLOT( slotZoom1() ), actionCollection(), "view_zoom_1" ); actMenu->insert( action ); // xgettext:no-c-format - action = new KAction( i18n( "200%" ), cut, this, TQT_SLOT( slotZoom2() ), + action = new KAction( i18n( "200%" ), cut, TQT_TQOBJECT(this), TQT_SLOT( slotZoom2() ), actionCollection(), "view_zoom_2" ); actMenu->insert( action ); // xgettext:no-c-format - action = new KAction( i18n( "500%" ), cut, this, TQT_SLOT( slotZoom5() ), + action = new KAction( i18n( "500%" ), cut, TQT_TQOBJECT(this), TQT_SLOT( slotZoom5() ), actionCollection(), "view_zoom_5" ); actMenu->insert( action ); // xgettext:no-c-format - action = new KAction( i18n( "1000%" ), cut, this, TQT_SLOT( slotZoom10() ), + action = new KAction( i18n( "1000%" ), cut, TQT_TQOBJECT(this), TQT_SLOT( slotZoom10() ), actionCollection(), "view_zoom_10" ); actMenu->insert( action ); // Settings Menu - KStdAction::keyBindings(this, TQT_SLOT(slotConfigureKeys()), + KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureKeys()), actionCollection()); - KStdAction::preferences(this, TQT_SLOT(slotConfigureSettings()), + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotConfigureSettings()), actionCollection()); createStandardStatusBarAction(); @@ -341,7 +341,7 @@ void KIconEdit::setupActions() KToggleAction *toggle; toggle = new KToggleAction( i18n( "Show &Grid" ), "grid", - cut, this, TQT_SLOT( slotShowGrid() ), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT( slotShowGrid() ), actionCollection(), "options_show_grid" ); toggle->setCheckedState(i18n("Hide &Grid")); toggle->setWhatsThis( i18n( "Show grid\n\nToggles the grid in the icon" @@ -350,14 +350,14 @@ void KIconEdit::setupActions() // Tools Menu toolAction = new KRadioAction(i18n("Color Picker"), "colorpicker", - cut, this, TQT_SLOT(slotToolPointer()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolPointer()), actionCollection(), "tool_find_pixel"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Color Picker\n\nThe color of the pixel clicked" " on will be the current draw color")); toolAction = new KRadioAction(i18n("Freehand"), "paintbrush", - cut, this, TQT_SLOT(slotToolFreehand()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolFreehand()), actionCollection(), "tool_freehand"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Free hand\n\nDraw non-linear lines")); @@ -366,64 +366,64 @@ void KIconEdit::setupActions() grid->setTool(KIconEditGrid::Freehand); toolAction = new KRadioAction(i18n("Rectangle"), "rectangle", - cut, this, TQT_SLOT(slotToolRectangle()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolRectangle()), actionCollection(), "tool_rectangle"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Rectangle\n\nDraw a rectangle")); toolAction = new KRadioAction(i18n("Filled Rectangle"), "filledrectangle", - cut, this, TQT_SLOT(slotToolFilledRectangle()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolFilledRectangle()), actionCollection(), "tool_filled_rectangle"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Filled rectangle\n\nDraw a filled rectangle")); toolAction = new KRadioAction(i18n("Circle"), "circle", - cut, this, TQT_SLOT(slotToolCircle()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolCircle()), actionCollection(), "tool_circle"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Circle\n\nDraw a circle")); toolAction = new KRadioAction(i18n("Filled Circle"), "filledcircle", - cut, this, TQT_SLOT(slotToolFilledCircle()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolFilledCircle()), actionCollection(), "tool_filled_circle"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Filled circle\n\nDraw a filled circle")); toolAction = new KRadioAction(i18n("Ellipse"), "ellipse", - cut, this, TQT_SLOT(slotToolEllipse()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolEllipse()), actionCollection(), "tool_ellipse"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Ellipse\n\nDraw an ellipse")); toolAction = new KRadioAction(i18n("Filled Ellipse"), "filledellipse", - cut, this, TQT_SLOT(slotToolFilledEllipse()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolFilledEllipse()), actionCollection(), "tool_filled_ellipse"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Filled ellipse\n\nDraw a filled ellipse")); toolAction = new KRadioAction(i18n("Spray"), "airbrush", - cut, this, TQT_SLOT(slotToolSpray()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolSpray()), actionCollection(), "tool_spray"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Spray\n\nDraw scattered pixels in the" " current color")); toolAction = new KRadioAction(i18n("Flood Fill"), "fill", - cut, this, TQT_SLOT(slotToolFlood()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolFlood()), actionCollection(), "tool_flood_fill"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Flood fill\n\nFill adjoining pixels with" " the same color with the current color")); toolAction = new KRadioAction(i18n("Line"), "line", - cut, this, TQT_SLOT(slotToolLine()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolLine()), actionCollection(), "tool_line"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Line\n\nDraw a straight line vertically," " horizontally or at 45 deg. angles")); toolAction = new KRadioAction(i18n("Eraser (Transparent)"), "eraser", - cut, this, TQT_SLOT(slotToolEraser()), actionCollection(), + cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolEraser()), actionCollection(), "tool_eraser"); toolAction->setExclusiveGroup("toolActions"); toolAction->setWhatsThis(i18n("Erase\n\nErase pixels. Set the pixels to" @@ -432,14 +432,14 @@ void KIconEdit::setupActions() " to use)")); toolAction = new KRadioAction(i18n("Rectangular Selection"), - "selectrect", cut, this, TQT_SLOT(slotToolSelectRect()), + "selectrect", cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolSelectRect()), actionCollection(), "edit_select_rectangle"); toolAction->setExclusiveGroup( "toolActions" ); toolAction->setWhatsThis(i18n("Select\n\nSelect a rectangular section" " of the icon using the mouse.")); toolAction = new KRadioAction(i18n("Circular Selection"), - "selectcircle", cut, this, TQT_SLOT(slotToolSelectCircle()), + "selectcircle", cut, TQT_TQOBJECT(this), TQT_SLOT(slotToolSelectCircle()), actionCollection(), "edit_select_circle"); toolAction->setExclusiveGroup( "toolActions" ); toolAction->setWhatsThis(i18n("Select\n\nSelect a circular section of the" @@ -451,7 +451,7 @@ void KIconEdit::updateAccels() actionCollection()->readShortcutSettings(); } -TQWidget *KIconEdit::createContainer( TQWidget *parent, int index, +TQWidget *KIconEdit::createContainer( TQWidget *tqparent, int index, const TQDomElement &element, int &id ) { if ( element.attribute( "name" ) == "paletteToolBar" ) @@ -461,7 +461,7 @@ TQWidget *KIconEdit::createContainer( TQWidget *parent, int index, return m_paletteToolBar; } - return KXMLGUIBuilder::createContainer( parent, index, element, id ); + return KXMLGUIBuilder::createContainer( tqparent, index, element, id ); } bool KIconEdit::setupStatusBar() @@ -477,7 +477,7 @@ bool KIconEdit::setupStatusBar() statusbar->insertFixedItem("99999,99999", 0, true); statusbar->insertFixedItem("99999 x 99999", 1, true); statusbar->insertFixedItem(" 1:999", 2, true); - str = i18n("Colors: %1").arg(9999999); + str = i18n("Colors: %1").tqarg(9999999); statusbar->insertFixedItem(str, 3, true); statusbar->insertItem("", 4); diff --git a/kiconedit/kiconedit.h b/kiconedit/kiconedit.h index 021223de..e912e0f7 100644 --- a/kiconedit/kiconedit.h +++ b/kiconedit/kiconedit.h @@ -59,12 +59,13 @@ class PaletteToolBar; class KIconEdit : public KMainWindow { Q_OBJECT + TQ_OBJECT public: KIconEdit( KURL url = KURL(), const char *name = "kiconedit"); KIconEdit( const TQImage image, const char *name = "kiconedit"); ~KIconEdit(); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; static WindowList windowList; signals: diff --git a/kiconedit/kiconeditslots.cpp b/kiconedit/kiconeditslots.cpp index ffcca476..63af706b 100644 --- a/kiconedit/kiconeditslots.cpp +++ b/kiconedit/kiconeditslots.cpp @@ -81,7 +81,7 @@ void KIconEdit::slotNew() if (grid->isModified()) { int r = KMessageBox::warningYesNoCancel(this, - i18n("The current file has been modified.\nDo you want to save it?"), TQString::null, KStdGuiItem::save(), KStdGuiItem::discard()); + i18n("The current file has been modified.\nDo you want to save it?"), TQString(), KStdGuiItem::save(), KStdGuiItem::discard()); switch(r) { @@ -136,7 +136,7 @@ void KIconEdit::slotOpen() if( grid->isModified() ) { int r = KMessageBox::warningYesNoCancel(this, - i18n("The current file has been modified.\nDo you want to save it?"),TQString::null, KStdGuiItem::save(), KStdGuiItem::discard()); + i18n("The current file has been modified.\nDo you want to save it?"),TQString(), KStdGuiItem::save(), KStdGuiItem::discard()); switch( r ) { @@ -195,7 +195,7 @@ void KIconEdit::slotPrint() { KPrinter printer; - if ( printer.setup(this, i18n("Print %1").arg(icon->url().section('/', -1))) ) + if ( printer.setup(this, i18n("Print %1").tqarg(icon->url().section('/', -1))) ) { int margin = 10, yPos = 0; printer.setCreator("KDE Icon Editor"); @@ -280,7 +280,7 @@ void KIconEdit::slotOpenRecent(const KURL& iconFile) if( grid->isModified() ) { int r = KMessageBox::warningYesNoCancel(this, - i18n("The current file has been modified.\nDo you want to save it?"),TQString::null, KStdGuiItem::save(), KStdGuiItem::discard()); + i18n("The current file has been modified.\nDo you want to save it?"),TQString(), KStdGuiItem::save(), KStdGuiItem::discard()); switch( r ) { @@ -422,13 +422,13 @@ void KIconEdit::slotUpdateZoom( int s ) void KIconEdit::slotUpdateStatusPos(int x, int y) { - TQString str = i18n("Status Position", "%1, %2").arg(x).arg(y); + TQString str = i18n("tqStatus Position", "%1, %2").tqarg(x).tqarg(y); statusbar->changeItem( str, 0); } void KIconEdit::slotUpdateStatusSize(int x, int y) { - TQString str = i18n("Status Size", "%1 x %2").arg(x).arg(y); + TQString str = i18n("tqStatus Size", "%1 x %2").tqarg(x).tqarg(y); statusbar->changeItem( str, 1); } @@ -443,13 +443,13 @@ void KIconEdit::slotUpdateStatusScaling(int s) void KIconEdit::slotUpdateStatusColors(uint) { - TQString str = i18n("Colors: %1").arg(grid->numColors()); + TQString str = i18n("Colors: %1").tqarg(grid->numColors()); statusbar->changeItem( str, 3); } void KIconEdit::slotUpdateStatusColors(uint n, uint *) { - TQString str = i18n("Colors: %1").arg(n); + TQString str = i18n("Colors: %1").tqarg(n); statusbar->changeItem( str, 3); } @@ -512,7 +512,7 @@ void KIconEdit::dragEnterEvent(TQDragEnterEvent* e) */ void KIconEdit::dropEvent( TQDropEvent *e ) { - //kdDebug(4640) << "Got QDropEvent!" << endl; + //kdDebug(4640) << "Got TQDropEvent!" << endl; KURL::List fileList; bool loadedinthis = false; diff --git a/kiconedit/kicongrid.cpp b/kiconedit/kicongrid.cpp index 2c9faeb7..d794cbe5 100644 --- a/kiconedit/kicongrid.cpp +++ b/kiconedit/kicongrid.cpp @@ -2,7 +2,7 @@ KDE Icon Editor - a small graphics drawing program for the KDE. Copyright (C) 1998 Thomas Tanghus ([email protected]) - Includes portions of code from Qt, + Includes portions of code from TQt, Copyright (C) 1992-2000 Trolltech AS. This program is free software; you can redistribute it and/or @@ -67,8 +67,8 @@ void RepaintCommand::execute() grid->update( area); } -KGridView::KGridView(TQImage *image, KCommandHistory* history, TQWidget *parent, const char *name) -: TQFrame(parent, name) +KGridView::KGridView(TQImage *image, KCommandHistory* history, TQWidget *tqparent, const char *name) +: TQFrame(tqparent, name) { _corner = 0L; _hruler = _vruler = 0L; @@ -290,8 +290,8 @@ void KGridView::resizeEvent(TQResizeEvent*) } -KIconEditGrid::KIconEditGrid(TQImage *image, KCommandHistory* h, TQWidget *parent, const char *name) - : KColorGrid(parent, name, 1) +KIconEditGrid::KIconEditGrid(TQImage *image, KCommandHistory* h, TQWidget *tqparent, const char *name) + : KColorGrid(tqparent, name, 1) { img = image; history = h; @@ -310,7 +310,7 @@ KIconEditGrid::KIconEditGrid(TQImage *image, KCommandHistory* h, TQWidget *paren img->setAlphaBuffer(true); clearImage(img); - currentcolor = qRgb(0,0,0)|OPAQUE_MASK; + currentcolor = tqRgb(0,0,0)|OPAQUE_MASK; emit colorSelected(currentcolor); setMouseTracking(true); @@ -348,13 +348,13 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) //time.start(); - QRgb *imageBuffer = new QRgb[paintCellsRect.width() * paintCellsRect.height()]; + TQRgb *imageBuffer = new TQRgb[paintCellsRect.width() * paintCellsRect.height()]; const int cellsize = cellSize(); const int firstCellPixelsRemaining = cellsize - paintCellsRect.left() % cellsize; if(transparencyDisplayType() == TRD_SOLIDCOLOR) { - const QRgb backgroundColor = transparencySolidColor().rgb(); + const TQRgb backgroundColor = transparencySolidColor().rgb(); const int backgroundRed = transparencySolidColor().red(); const int backgroundGreen = transparencySolidColor().green(); const int backgroundBlue = transparencySolidColor().blue(); @@ -362,19 +362,19 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) for(int y = paintCellsRect.top(); y <= paintCellsRect.bottom(); y++) { - QRgb *dest = imageBuffer + (y - paintCellsRect.top()) * paintCellsRect.width(); + TQRgb *dest = imageBuffer + (y - paintCellsRect.top()) * paintCellsRect.width(); if(y % cellsize == 0 || dest == imageBuffer) { // Paint the first scanline in each block of cellSize() identical lines. // The remaineder can just be copied from this one. const int cellY = y / cellsize; - QRgb *src = gridcolors.data() + cellY * numCols() + firstCellX; + TQRgb *src = gridcolors.data() + cellY * numCols() + firstCellX; - QRgb sourcePixel = *src++; - int sourceAlpha = qAlpha(sourcePixel); + TQRgb sourcePixel = *src++; + int sourceAlpha = tqAlpha(sourcePixel); - QRgb c; + TQRgb c; if(sourceAlpha == 255) { @@ -387,9 +387,9 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) } else { - const int sourceRed = qRed(sourcePixel); - const int sourceGreen = qGreen(sourcePixel); - const int sourceBlue = qBlue(sourcePixel); + const int sourceRed = tqRed(sourcePixel); + const int sourceGreen = tqGreen(sourcePixel); + const int sourceBlue = tqBlue(sourcePixel); int r = (sourceAlpha * (sourceRed - backgroundRed)) + 0x80; r = backgroundRed + ((r + (r >> 8)) >> 8); @@ -400,7 +400,7 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) int b = (sourceAlpha * (sourceBlue - backgroundBlue)) + 0x80; b = backgroundBlue + ((b + (b >> 8)) >> 8); - c = qRgb(r, g, b); + c = tqRgb(r, g, b); } int cellPixelsRemaining = firstCellPixelsRemaining; @@ -413,7 +413,7 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) // Fetch the next source pixel sourcePixel = *src++; - sourceAlpha = qAlpha(sourcePixel); + sourceAlpha = tqAlpha(sourcePixel); if(sourceAlpha == 255) { @@ -426,9 +426,9 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) } else { - const int sourceRed = qRed(sourcePixel); - const int sourceGreen = qGreen(sourcePixel); - const int sourceBlue = qBlue(sourcePixel); + const int sourceRed = tqRed(sourcePixel); + const int sourceGreen = tqGreen(sourcePixel); + const int sourceBlue = tqBlue(sourcePixel); //int r = backgroundRed + (sourceAlpha * (sourceRed - backgroundRed)) / 255; //int g = backgroundGreen + (sourceAlpha * (sourceGreen - backgroundGreen)) / 255; @@ -443,7 +443,7 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) int b = (sourceAlpha * (sourceBlue - backgroundBlue)) + 0x80; b = backgroundBlue + ((b + (b >> 8)) >> 8); - c = qRgb(r, g, b); + c = tqRgb(r, g, b); } } @@ -455,7 +455,7 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) else { // Copy the scanline above. - memcpy(dest, dest - paintCellsRect.width(), paintCellsRect.width() * sizeof(QRgb)); + memcpy(dest, dest - paintCellsRect.width(), paintCellsRect.width() * sizeof(TQRgb)); } } } @@ -478,10 +478,10 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) squareSize = (2 * cellSize() * fixedPointMultiplier) / 2; } - QRgb *color1ScanLine = new QRgb[paintCellsRect.width()]; - QRgb *color2ScanLine = new QRgb[paintCellsRect.width()]; - QRgb *color1Buffer = color1ScanLine; - QRgb *color2Buffer = color2ScanLine; + TQRgb *color1ScanLine = new TQRgb[paintCellsRect.width()]; + TQRgb *color2ScanLine = new TQRgb[paintCellsRect.width()]; + TQRgb *color1Buffer = color1ScanLine; + TQRgb *color2Buffer = color2ScanLine; for(int x = paintCellsRect.left(); x <= paintCellsRect.right(); x++) { @@ -504,11 +504,11 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) for(int y = paintCellsRect.top(); y <= paintCellsRect.bottom(); y++) { - QRgb *dest = imageBuffer + (y - paintCellsRect.top()) * paintCellsRect.width(); + TQRgb *dest = imageBuffer + (y - paintCellsRect.top()) * paintCellsRect.width(); const int cellY = y / cellsize; int firstSquareColour; - const QRgb *checkerboardSrc; + const TQRgb *checkerboardSrc; if((((y * fixedPointMultiplier) / squareSize) & 1) == 0) { @@ -524,17 +524,17 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) if(cellY == lastCellY && firstSquareColour == lastLineFirstSquareColour) { // Copy the scanline above. - memcpy(dest, dest - paintCellsRect.width(), paintCellsRect.width() * sizeof(QRgb)); + memcpy(dest, dest - paintCellsRect.width(), paintCellsRect.width() * sizeof(TQRgb)); } else { - QRgb *src = gridcolors.data() + cellY * numCols() + firstCellX; + TQRgb *src = gridcolors.data() + cellY * numCols() + firstCellX; - QRgb sourcePixel = *src++; - int sourceRed = qRed(sourcePixel); - int sourceGreen = qGreen(sourcePixel); - int sourceBlue = qBlue(sourcePixel); - int sourceAlpha = qAlpha(sourcePixel); + TQRgb sourcePixel = *src++; + int sourceRed = tqRed(sourcePixel); + int sourceGreen = tqGreen(sourcePixel); + int sourceBlue = tqBlue(sourcePixel); + int sourceAlpha = tqAlpha(sourcePixel); int cellPixelsRemaining = firstCellPixelsRemaining; @@ -546,15 +546,15 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) // Fetch the next source pixel sourcePixel = *src++; - sourceRed = qRed(sourcePixel); - sourceGreen = qGreen(sourcePixel); - sourceBlue = qBlue(sourcePixel); - sourceAlpha = qAlpha(sourcePixel); + sourceRed = tqRed(sourcePixel); + sourceGreen = tqGreen(sourcePixel); + sourceBlue = tqBlue(sourcePixel); + sourceAlpha = tqAlpha(sourcePixel); } cellPixelsRemaining--; - QRgb c; + TQRgb c; if(sourceAlpha == 255) { @@ -568,9 +568,9 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) else { const int backgroundColor = *checkerboardSrc; - const int backgroundRed = qRed(backgroundColor); - const int backgroundGreen = qGreen(backgroundColor); - const int backgroundBlue = qBlue(backgroundColor); + const int backgroundRed = tqRed(backgroundColor); + const int backgroundGreen = tqGreen(backgroundColor); + const int backgroundBlue = tqBlue(backgroundColor); //int r = backgroundRed + (sourceAlpha * (sourceRed - backgroundRed)) / 255; //int g = backgroundGreen + (sourceAlpha * (sourceGreen - backgroundGreen)) / 255; @@ -585,7 +585,7 @@ void KIconEditGrid::paintEvent(TQPaintEvent *e) int b = (sourceAlpha * (sourceBlue - backgroundBlue)) + 0x80; b = backgroundBlue + ((b + (b >> 8)) >> 8); - c = qRgb(r, g, b); + c = tqRgb(r, g, b); } *dest++ = c; @@ -710,7 +710,7 @@ void KIconEditGrid::paintForeground(TQPainter* p, TQPaintEvent* e) void KIconEditGrid::mousePressEvent( TQMouseEvent *e ) { - if(!e || (e->button() != LeftButton)) + if(!e || (e->button() != Qt::LeftButton)) return; int row = findRow( e->pos().y() ); @@ -886,7 +886,7 @@ void KIconEditGrid::mouseMoveEvent( TQMouseEvent *e ) void KIconEditGrid::mouseReleaseEvent( TQMouseEvent *e ) { - if(!e || (e->button() != LeftButton)) + if(!e || (e->button() != Qt::LeftButton)) return; int row = findRow( e->pos().y() ); @@ -1035,7 +1035,7 @@ void KIconEditGrid::load( TQImage *image) setColor((y*numCols())+x, *l, false); } //kdDebug(4640) << "Row: " << y << endl; - kapp->processEvents(200); + kapp->tqprocessEvents(200); } updateColors(); @@ -1044,7 +1044,7 @@ void KIconEditGrid::load( TQImage *image) emit changed(pixmap()); setUpdatesEnabled(true); emit needPainting(); - //repaint(viewRect(), false); + //tqrepaint(viewRect(), false); history->clear(); } @@ -1108,7 +1108,7 @@ void KIconEditGrid::checkClipboard() TQImage KIconEditGrid::clipboardImage(bool &ok) { //###### Remove me later. - //Workaround Qt bug -- check whether format provided first. + //Workaround TQt bug -- check whether format provided first. //Code below is from TQDragObject, to match the mimetype list.... TQStrList fileFormats = TQImageIO::inputFormats(); @@ -1118,7 +1118,7 @@ TQImage KIconEditGrid::clipboardImage(bool &ok) { TQCString format = fileFormats.current(); TQCString type = "image/" + format.lower(); - if (kapp->clipboard()->data()->provides(type ) ) + if (kapp->tqclipboard()->data()->provides(type ) ) { oneIsSupported = true; } @@ -1179,7 +1179,7 @@ TQImage KIconEditGrid::getSelection(bool cut) { int x = pntarray[i].x(); int y = pntarray[i].y(); - if(img->valid(x, y) && rect.contains(TQPoint(x, y))) + if(img->valid(x, y) && rect.tqcontains(TQPoint(x, y))) { *((uint*)tmp.scanLine(y-ny) + (x-nx)) = *((uint*)img->scanLine(y) + x); if(cut) @@ -1232,7 +1232,7 @@ void KIconEditGrid::editPaste(bool paste) { if(KMessageBox::warningYesNo(this, i18n("The clipboard image is larger than the current" - " image!\nPaste as new image?"),TQString::null,i18n("Paste"), i18n("Do Not Paste")) == 0) + " image!\nPaste as new image?"),TQString(),i18n("Paste"), i18n("Do Not Paste")) == 0) { editPasteAsNew(); } @@ -1263,12 +1263,12 @@ void KIconEditGrid::editPaste(bool paste) else { // Porter-Duff Over composition - double alphaS = qAlpha(*cl) / 255.0; - double alphaD = qAlpha(*l) / 255.0; + double alphaS = tqAlpha(*cl) / 255.0; + double alphaD = tqAlpha(*l) / 255.0; - double r = qRed(*cl) * alphaS + (1 - alphaS) * qRed(*l) * alphaD; - double g = qGreen(*cl) * alphaS + (1 - alphaS) * qGreen(*l) * alphaD; - double b = qBlue(*cl) * alphaS + (1 - alphaS) * qBlue(*l) * alphaD; + double r = tqRed(*cl) * alphaS + (1 - alphaS) * tqRed(*l) * alphaD; + double g = tqGreen(*cl) * alphaS + (1 - alphaS) * tqGreen(*l) * alphaD; + double b = tqBlue(*cl) * alphaS + (1 - alphaS) * tqBlue(*l) * alphaD; double a = alphaS + (1 - alphaS) * alphaD; // Remove multiplication by alpha @@ -1334,7 +1334,7 @@ void KIconEditGrid::editPaste(bool paste) ia = 255; } - *l = qRgba(ir, ig, ib, ia); + *l = tqRgba(ir, ig, ib, ia); } setColor((y*numCols())+x, (uint)*l, false); @@ -1379,7 +1379,7 @@ void KIconEditGrid::editPasteAsNew() *img = tmp; load(img); setModified(true); - //repaint(viewRect(), false); + //tqrepaint(viewRect(), false); p = *img; emit changed(TQPixmap(p)); @@ -1426,7 +1426,7 @@ void KIconEditGrid::setSize(const TQSize s) void KIconEditGrid::createCursors() { - TQBitmap mask(22, 22); + TQBitmap tqmask(22, 22); TQPixmap pix; cursor_normal = TQCursor(arrowCursor); @@ -1439,8 +1439,8 @@ void KIconEditGrid::createCursors() } else { - mask = pix.createHeuristicMask(); - pix.setMask(mask); + tqmask = TQPixmap(pix.createHeuristicMask()); + pix.setMask(tqmask); cursor_colorpicker = TQCursor(pix, 1, 21); } @@ -1452,8 +1452,8 @@ void KIconEditGrid::createCursors() } else { - mask = pix.createHeuristicMask(); - pix.setMask(mask); + tqmask = TQPixmap(pix.createHeuristicMask()); + pix.setMask(tqmask); cursor_paint = TQCursor(pix, 0, 19); } @@ -1465,8 +1465,8 @@ void KIconEditGrid::createCursors() } else { - mask = pix.createHeuristicMask(); - pix.setMask(mask); + tqmask = TQPixmap(pix.createHeuristicMask()); + pix.setMask(tqmask); cursor_flood = TQCursor(pix, 3, 20); } @@ -1478,8 +1478,8 @@ void KIconEditGrid::createCursors() } else { - mask = pix.createHeuristicMask(); - pix.setMask(mask); + tqmask = TQPixmap(pix.createHeuristicMask()); + pix.setMask(tqmask); cursor_aim = TQCursor(pix, 10, 10); } @@ -1491,8 +1491,8 @@ void KIconEditGrid::createCursors() } else { - mask = pix.createHeuristicMask(true); - pix.setMask(mask); + tqmask = TQPixmap(pix.createHeuristicMask(true)); + pix.setMask(tqmask); cursor_spray = TQCursor(pix, 0, 20); } @@ -1504,8 +1504,8 @@ void KIconEditGrid::createCursors() } else { - mask = pix.createHeuristicMask(true); - pix.setMask(mask); + tqmask = TQPixmap(pix.createHeuristicMask(true)); + pix.setMask(tqmask); cursor_erase = TQCursor(pix, 1, 16); } } @@ -1600,11 +1600,11 @@ void KIconEditGrid::drawSpray(TQPoint point) } -//This routine is from Qt sources -- it's the branch of TQPointArray::makeEllipse( int x, int y, int w, int h ) that's not normally compiled -//It seems like KIconEdit relied on the Qt1 semantics for makeEllipse, which broke -//the tool with reasonably recent Qt versions. -//Thankfully, Qt includes the old code #ifdef'd, which is hence included here -static void QPA_makeEllipse(TQPointArray& ar, int x, int y, int w, int h ) +//This routine is from TQt sources -- it's the branch of TQPointArray::makeEllipse( int x, int y, int w, int h ) that's not normally compiled +//It seems like KIconEdit relied on the TQt1 semantics for makeEllipse, which broke +//the tool with reasonably recent TQt versions. +//Thankfully, TQt includes the old code #ifdef'd, which is hence included here +static void TQPA_makeEllipse(TQPointArray& ar, int x, int y, int w, int h ) { // midpoint, 1/4 ellipse if ( w <= 0 || h <= 0 ) { if ( w == 0 || h == 0 ) { @@ -1712,9 +1712,9 @@ void KIconEditGrid::drawEllipse(bool drawit) drawPointArray(a, Mark); if(tool == Circle || tool == FilledCircle || tool == SelectCircle) - QPA_makeEllipse(pntarray, x, y, d, d); + TQPA_makeEllipse(pntarray, x, y, d, d); else if(tool == Ellipse || tool == FilledEllipse) - QPA_makeEllipse(pntarray, x, y, cx, cy); + TQPA_makeEllipse(pntarray, x, y, cx, cy); if((tool == FilledEllipse) || (tool == FilledCircle) || (tool == SelectCircle)) @@ -1829,7 +1829,7 @@ void KIconEditGrid::drawLine(bool drawit, bool drawStraight) x = start.x(); y = start.y(); - delta = QMAX(abs(dx), abs(dy)); + delta = TQMAX(abs(dx), abs(dy)); int deltaX = abs(dx); int deltaY = abs(dy); @@ -1909,7 +1909,7 @@ void KIconEditGrid::drawPointArray(TQPointArray a, DrawAction action) int x = a[i].x(); int y = a[i].y(); - if(img->valid(x, y) && a.boundingRect().contains(a[ i ])) + if(img->valid(x, y) && TQT_TQRECT_OBJECT(a.boundingRect()).tqcontains(a[ i ])) { //kdDebug(4640) << "x: " << x << " - y: " << y << endl; switch( action ) @@ -1982,10 +1982,10 @@ bool KIconEditGrid::isMarked(int x, int y) // Fast diffuse dither to 3x3x3 color cube -// Based on Qt's image conversion functions +// Based on TQt's image conversion functions static bool kdither_32_to_8( const TQImage *src, TQImage *dst ) { - register QRgb *p; + register TQRgb *p; uchar *b; int y; @@ -2041,7 +2041,7 @@ static bool kdither_32_to_8( const TQImage *src, TQImage *dst ) for ( bc=0; bc<=MAX_B; bc++ ) { dst->setColor( INDEXOF(rc,gc,bc), - qRgb( rc*255/MAX_R, gc*255/MAX_G, bc*255/MAX_B ) ); + tqRgb( rc*255/MAX_R, gc*255/MAX_G, bc*255/MAX_B ) ); } int sw = src->width(); @@ -2061,12 +2061,12 @@ static bool kdither_32_to_8( const TQImage *src, TQImage *dst ) for ( y=0; y < src->height(); y++ ) { - p = (QRgb *)src->scanLine(y); + p = (TQRgb *)src->scanLine(y); b = dst->scanLine(y); int endian = (TQImage::systemByteOrder() == TQImage::BigEndian); int x; - uchar* q = src->scanLine(y); - uchar* q2 = src->scanLine(y+1 < src->height() ? y + 1 : 0); + uchar* q = const_cast<TQImage*>(src)->scanLine(y); + uchar* q2 = const_cast<TQImage*>(src)->scanLine(y+1 < src->height() ? y + 1 : 0); for (int chan = 0; chan < 3; chan++) { b = dst->scanLine(y); @@ -2087,7 +2087,7 @@ static bool kdither_32_to_8( const TQImage *src, TQImage *dst ) { for (x=0; x<sw; x++) { - int pix = QMAX(QMIN(2, (l1[x] * 2 + 128)/ 255), 0); + int pix = TQMAX(TQMIN(2, (l1[x] * 2 + 128)/ 255), 0); int err = l1[x] - pix * 255 / 2; pv[chan][x] = pix; @@ -2106,7 +2106,7 @@ static bool kdither_32_to_8( const TQImage *src, TQImage *dst ) { for (x=sw; x-->0; ) { - int pix = QMAX(QMIN(2, (l1[x] * 2 + 128)/ 255), 0); + int pix = TQMAX(TQMIN(2, (l1[x] * 2 + 128)/ 255), 0); int err = l1[x] - pix * 255 / 2; pv[chan][x] = pix; @@ -2180,7 +2180,7 @@ void KIconEditGrid::mapToKDEPalette() return; /* -#if QT_VERSION > 140 +#if [[[TQT_VERSION IS DEPRECATED]]] > 140 *img = img->convertDepthWithPalette(32, iconpalette, 42); load(img); return; @@ -2195,7 +2195,7 @@ void KIconEditGrid::mapToKDEPalette() { if(*l != TRANSPARENT) { - if(!iconcolors.contains(*l)) + if(!iconcolors.tqcontains(*l)) *l = iconcolors.closestMatch(*l); } } @@ -2216,8 +2216,8 @@ void KIconEditGrid::grayScale() { if(*l != TRANSPARENT) { - uint c = qGray(*l); - *l = qRgba(c, c, c, qAlpha(*l)); + uint c = tqGray(*l); + *l = tqRgba(c, c, c, tqAlpha(*l)); } } } diff --git a/kiconedit/kicongrid.h b/kiconedit/kicongrid.h index da61f3a1..3ef73690 100644 --- a/kiconedit/kicongrid.h +++ b/kiconedit/kicongrid.h @@ -80,18 +80,19 @@ class RepaintCommand : public KCommand { } TQString name() const { - return "repainted"; + return "tqrepainted"; } protected: KIconEditGrid* grid; TQRect area; }; -class KGridView : public QFrame +class KGridView : public TQFrame { Q_OBJECT + TQ_OBJECT public: - KGridView( TQImage *image, KCommandHistory* history, TQWidget * parent = 0, const char *name = 0); + KGridView( TQImage *image, KCommandHistory* history, TQWidget * tqparent = 0, const char *name = 0); KRuler *hruler() { return _hruler;} KRuler *vruler() { return _vruler;} @@ -131,8 +132,9 @@ protected: class KIconEditGrid : public KColorGrid { Q_OBJECT + TQ_OBJECT public: - KIconEditGrid( TQImage *image, KCommandHistory* h, TQWidget * parent = 0, const char *name = 0); + KIconEditGrid( TQImage *image, KCommandHistory* h, TQWidget * tqparent = 0, const char *name = 0); virtual ~KIconEditGrid(); enum DrawTool { Line, Freehand, FloodFill, Spray, Rect, FilledRect, Circle, @@ -189,7 +191,7 @@ public slots: void editSelectAll(); void editClear(); void getImage(TQImage *image); -//#if QT_VERSION <= 140 +//#if [[[TQT_VERSION IS DEPRECATED]]] <= 140 void editResize(); //#endif void setSize(const TQSize s); diff --git a/kiconedit/knew.cpp b/kiconedit/knew.cpp index 77f7ee99..b611a624 100644 --- a/kiconedit/knew.cpp +++ b/kiconedit/knew.cpp @@ -145,7 +145,7 @@ void KIconListBoxItem::paint( TQPainter *p ) int KIconListBoxItem::height(const TQListBox *lb ) const { - return QMAX( pm.height(), lb->fontMetrics().lineSpacing() + 1 ); + return TQMAX( pm.height(), lb->fontMetrics().lineSpacing() + 1 ); } int KIconListBoxItem::width(const TQListBox *lb ) const @@ -153,9 +153,9 @@ int KIconListBoxItem::width(const TQListBox *lb ) const return pm.width() + lb->fontMetrics().width( text() ) + 6; } -NewSelect::NewSelect(TQWidget *parent) : TQWidget( parent ) +NewSelect::NewSelect(TQWidget *tqparent) : TQWidget( tqparent ) { - wiz = (KWizard*) parent; + wiz = (KWizard*) tqparent; grp = new TQButtonGroup( this ); connect( grp, TQT_SIGNAL( clicked( int ) ), TQT_SLOT( buttonClicked( int ) ) ); grp->setExclusive( true ); @@ -173,7 +173,7 @@ NewSelect::NewSelect(TQWidget *parent) : TQWidget( parent ) l->addWidget( rbtempl, 1 ); //l->addWidget(rbtempl, 5, AlignLeft); - //grp->setMinimumSize(grp->childrenRect().size()); + //grp->setMinimumSize(grp->tqchildrenRect().size()); grp->setButton( 0 ); } @@ -189,10 +189,10 @@ void NewSelect::buttonClicked(int id) emit iconopenstyle(id); } -NewFromTemplate::NewFromTemplate( TQWidget* parent ) - : TQWidget( parent ) +NewFromTemplate::NewFromTemplate( TQWidget* tqparent ) + : TQWidget( tqparent ) { - wiz = (KWizard*) parent; + wiz = (KWizard*) tqparent; TQVBoxLayout* ml = new TQVBoxLayout(this); @@ -223,8 +223,8 @@ void NewFromTemplate::checkSelection( int ) wiz->finishButton()->setEnabled( false ); } -KNewIcon::KNewIcon( TQWidget* parent ) - : KWizard( parent, 0, true ) +KNewIcon::KNewIcon( TQWidget* tqparent ) + : KWizard( tqparent, 0, true ) { //kdDebug(4640) << "KNewIcon" << endl; setCaption( i18n( "Create New Icon" ) ); diff --git a/kiconedit/knew.h b/kiconedit/knew.h index a2d5dc7e..4bfb7086 100644 --- a/kiconedit/knew.h +++ b/kiconedit/knew.h @@ -64,8 +64,9 @@ private: class KIconListBox : public TQListBox { Q_OBJECT + TQ_OBJECT public: - KIconListBox( TQWidget *parent ) : TQListBox(parent) {} ; + KIconListBox( TQWidget *tqparent ) : TQListBox(tqparent) {} ; const TQString path(int idx) { return ((KIconListBoxItem*)item(idx))->path(); } KIconTemplate& iconTemplate(int idx) { return ((KIconListBoxItem*)item(idx))->iconTemplate(); } @@ -93,11 +94,12 @@ private: ~KIconTemplateContainer(); }; -class NewSelect : public QWidget +class NewSelect : public TQWidget { Q_OBJECT + TQ_OBJECT public: - NewSelect(TQWidget *parent); + NewSelect(TQWidget *tqparent); ~NewSelect(); signals: @@ -112,11 +114,12 @@ protected: TQRadioButton *rbscratch, *rbtempl; }; -class NewFromTemplate : public QWidget +class NewFromTemplate : public TQWidget { Q_OBJECT + TQ_OBJECT public: - NewFromTemplate(TQWidget *parent); + NewFromTemplate(TQWidget *tqparent); ~NewFromTemplate(); const TQString path() { return TQString(templates->path(templates->currentItem())); } @@ -133,8 +136,9 @@ protected: class KNewIcon : public KWizard { Q_OBJECT + TQ_OBJECT public: - KNewIcon(TQWidget *parent); + KNewIcon(TQWidget *tqparent); ~KNewIcon(); enum { Blank = 0, Template = 1}; diff --git a/kiconedit/kresize.cpp b/kiconedit/kresize.cpp index b2af86b6..b290cce7 100644 --- a/kiconedit/kresize.cpp +++ b/kiconedit/kresize.cpp @@ -28,8 +28,8 @@ #include "kresize.h" -KResizeWidget::KResizeWidget( TQWidget* parent, const char* name, - const TQSize& size ) : TQWidget( parent, name ) +KResizeWidget::KResizeWidget( TQWidget* tqparent, const char* name, + const TQSize& size ) : TQWidget( tqparent, name ) { TQHBoxLayout* genLayout = new TQHBoxLayout( this ); @@ -37,18 +37,18 @@ KResizeWidget::KResizeWidget( TQWidget* parent, const char* name, group->setColumnLayout( 0, Qt::Horizontal ); genLayout->addWidget( group ); - TQHBoxLayout* layout = new TQHBoxLayout( group->layout(), 6 ); + TQHBoxLayout* tqlayout = new TQHBoxLayout( group->tqlayout(), 6 ); m_width = new KIntSpinBox( 1, 200, 1, 1, 10, group ); m_width->setValue( size.width() ); - layout->addWidget( m_width, 1 ); + tqlayout->addWidget( m_width, 1 ); TQLabel* label = new TQLabel( "X", group ); - layout->addWidget( label ); + tqlayout->addWidget( label ); m_height = new KIntSpinBox( 1, 200, 1, 1, 10, group); m_height->setValue( size.height() ); - layout->addWidget( m_height, 1 ); + tqlayout->addWidget( m_height, 1 ); setMinimumSize( 200, 100 ); } @@ -62,9 +62,9 @@ const TQSize KResizeWidget::getSize() return TQSize( m_width->value(), m_height->value() ); } -KResizeDialog::KResizeDialog( TQWidget* parent, const char* name, +KResizeDialog::KResizeDialog( TQWidget* tqparent, const char* name, const TQSize size ) - : KDialogBase( parent, name, true, i18n( "Select Size" ), Ok|Cancel ) + : KDialogBase( tqparent, name, true, i18n( "Select Size" ), Ok|Cancel ) { m_resize = new KResizeWidget( this, "resize widget", size ); diff --git a/kiconedit/kresize.h b/kiconedit/kresize.h index d3256232..37158ed3 100644 --- a/kiconedit/kresize.h +++ b/kiconedit/kresize.h @@ -26,13 +26,14 @@ class KIntSpinBox; -class KResizeWidget : public QWidget +class KResizeWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KResizeWidget( TQWidget* parent, const char* name, const TQSize& ); + KResizeWidget( TQWidget* tqparent, const char* name, const TQSize& ); ~KResizeWidget(); const TQSize getSize(); @@ -46,10 +47,11 @@ private: class KResizeDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KResizeDialog( TQWidget* parent, const char* name, const TQSize s ); + KResizeDialog( TQWidget* tqparent, const char* name, const TQSize s ); ~KResizeDialog(); const TQSize getSize(); diff --git a/kiconedit/palettetoolbar.cpp b/kiconedit/palettetoolbar.cpp index 07fa30b1..bb9b1f1c 100644 --- a/kiconedit/palettetoolbar.cpp +++ b/kiconedit/palettetoolbar.cpp @@ -30,8 +30,8 @@ #include "kiconcolors.h" #include "palettetoolbar.h" -PaletteToolBar::PaletteToolBar( TQWidget *parent, const char *name ) - : KToolBar( parent, name ) +PaletteToolBar::PaletteToolBar( TQWidget *tqparent, const char *name ) + : KToolBar( tqparent, name ) { TQWidget *base = new TQWidget( this ); @@ -42,7 +42,7 @@ PaletteToolBar::PaletteToolBar( TQWidget *parent, const char *name ) m_lblPreview = new TQLabel( base ); m_lblPreview->setFrameStyle( TQFrame::Panel|TQFrame::Sunken ); m_lblPreview->setFixedHeight( 64 ); - m_lblPreview->setAlignment( Qt::AlignHCenter|Qt::AlignVCenter ); + m_lblPreview->tqsetAlignment( TQt::AlignHCenter|TQt::AlignVCenter ); TQWhatsThis::add(m_lblPreview, i18n( "Preview\n\nThis is a 1:1 preview" " of the current icon" ) ); m_layout->addWidget( m_lblPreview ); @@ -50,31 +50,31 @@ PaletteToolBar::PaletteToolBar( TQWidget *parent, const char *name ) m_currentColorView = new TQLabel( base ); m_currentColorView->setFrameStyle( TQFrame::Panel|TQFrame::Sunken ); m_currentColorView->setFixedHeight( 24 ); - m_currentColorView->setAlignment( Qt::AlignHCenter|Qt::AlignVCenter ); + m_currentColorView->tqsetAlignment( TQt::AlignHCenter|TQt::AlignVCenter ); TQWhatsThis::add(m_currentColorView, i18n( "Current color\n\nThis is the currently selected color" ) ); m_layout->addWidget( m_currentColorView ); - TQVBoxLayout *vlayout = new TQVBoxLayout( m_layout, 0 ); + TQVBoxLayout *vtqlayout = new TQVBoxLayout( m_layout, 0 ); TQLabel *l = new TQLabel( i18n( "System colors:" ), base ); - vlayout->addWidget( l ); + vtqlayout->addWidget( l ); m_sysColors = new KSysColors( base ); TQWhatsThis::add(m_sysColors, i18n( "System colors\n\nHere you can select" " colors from the KDE icon palette" ) ); - vlayout->addWidget( m_sysColors ); + vtqlayout->addWidget( m_sysColors ); connect( m_sysColors, TQT_SIGNAL( newColor(uint) ), TQT_SIGNAL( newColor(uint) ) ); - vlayout = new TQVBoxLayout( m_layout, 0 ); + vtqlayout = new TQVBoxLayout( m_layout, 0 ); l = new TQLabel( i18n( "Custom colors:" ), base ); - vlayout->addWidget( l ); + vtqlayout->addWidget( l ); m_customColors = new KCustomColors( base ); TQWhatsThis::add(m_customColors, i18n( "Custom colors\n\nHere you can" " build a palette of custom colors.\nDouble-click on a box to edit" " the color" ) ); - vlayout->addWidget( m_customColors ); + vtqlayout->addWidget( m_customColors ); connect( m_customColors, TQT_SIGNAL( newColor(uint) ), TQT_SIGNAL( newColor(uint) ) ); @@ -86,7 +86,7 @@ PaletteToolBar::PaletteToolBar( TQWidget *parent, const char *name ) setMovingEnabled( false ); } -void PaletteToolBar::setOrientation( Orientation o ) +void PaletteToolBar::setOrientation( Qt::Orientation o ) { if( barPos() == Floating ) o = o == Qt::Vertical ? Qt::Horizontal : Qt::Vertical; @@ -112,7 +112,7 @@ void PaletteToolBar::addColors( uint n, uint *c ) void PaletteToolBar::addColor( uint color ) { - if( !m_sysColors->contains( color ) ) + if( !m_sysColors->tqcontains( color ) ) m_customColors->addColor( color ); } @@ -128,7 +128,7 @@ void PaletteToolBar::setPreviewBackground( const TQColor& colour ) void PaletteToolBar::currentColorChanged(uint color) { - if(qAlpha(color) == 255) + if(tqAlpha(color) == 255) { m_currentColorView->setBackgroundColor(color); } @@ -136,32 +136,32 @@ void PaletteToolBar::currentColorChanged(uint color) { // Show the colour as if drawn over a checkerboard pattern const int squareWidth = 8; - const uint lightColour = qRgb(255, 255, 255); - const uint darkColour = qRgb(127, 127, 127); + const uint lightColour = tqRgb(255, 255, 255); + const uint darkColour = tqRgb(127, 127, 127); TQPixmap pm(2 * squareWidth, 2 * squareWidth); TQPainter p(&pm); - double alpha = qAlpha(color) / 255.0; + double alpha = tqAlpha(color) / 255.0; - int r = int(qRed(color) * alpha + (1 - alpha) * qRed(lightColour) + 0.5); - int g = int(qGreen(color) * alpha + (1 - alpha) * qGreen(lightColour) + 0.5); - int b = int(qBlue(color) * alpha + (1 - alpha) * qBlue(lightColour) + 0.5); + int r = int(tqRed(color) * alpha + (1 - alpha) * tqRed(lightColour) + 0.5); + int g = int(tqGreen(color) * alpha + (1 - alpha) * tqGreen(lightColour) + 0.5); + int b = int(tqBlue(color) * alpha + (1 - alpha) * tqBlue(lightColour) + 0.5); - uint squareColour = qRgb(r, g, b); + uint squareColour = tqRgb(r, g, b); - p.setPen(Qt::NoPen); - p.setBrush(squareColour); + p.setPen(TQt::NoPen); + p.setBrush(TQColor(squareColour)); p.drawRect(0, 0, squareWidth, squareWidth); p.drawRect(squareWidth, squareWidth, squareWidth, squareWidth); - r = int(qRed(color) * alpha + (1 - alpha) * qRed(darkColour) + 0.5); - g = int(qGreen(color) * alpha + (1 - alpha) * qGreen(darkColour) + 0.5); - b = int(qBlue(color) * alpha + (1 - alpha) * qBlue(darkColour) + 0.5); + r = int(tqRed(color) * alpha + (1 - alpha) * tqRed(darkColour) + 0.5); + g = int(tqGreen(color) * alpha + (1 - alpha) * tqGreen(darkColour) + 0.5); + b = int(tqBlue(color) * alpha + (1 - alpha) * tqBlue(darkColour) + 0.5); - squareColour = qRgb(r, g, b); + squareColour = tqRgb(r, g, b); - p.setBrush(squareColour); + p.setBrush(TQColor(squareColour)); p.drawRect(squareWidth, 0, squareWidth, squareWidth); p.drawRect(0, squareWidth, squareWidth, squareWidth); diff --git a/kiconedit/palettetoolbar.h b/kiconedit/palettetoolbar.h index 1fede533..0e53914e 100644 --- a/kiconedit/palettetoolbar.h +++ b/kiconedit/palettetoolbar.h @@ -32,15 +32,16 @@ class KCustomColors; class PaletteToolBar : public KToolBar { Q_OBJECT + TQ_OBJECT public: - PaletteToolBar( TQWidget *parent, const char *name = 0L ); + PaletteToolBar( TQWidget *tqparent, const char *name = 0L ); signals: void newColor( uint c ); public slots: - virtual void setOrientation( Orientation o ); + virtual void setOrientation( Qt::Orientation o ); void previewChanged( const TQPixmap &p ); void addColors( uint n, uint *c ); void addColor( uint color ); diff --git a/kiconedit/properties.h b/kiconedit/properties.h index 7e97b9b4..0f4e7b0e 100644 --- a/kiconedit/properties.h +++ b/kiconedit/properties.h @@ -26,7 +26,7 @@ #include "kicongrid.h" -class KIconEditProperties : public QObject +class KIconEditProperties : public TQObject { public: static KIconEditProperties* self(); |