diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-19 19:03:33 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-19 19:03:33 +0000 |
commit | e69e8b1d09fb579316595b4e6a850e717358a8b1 (patch) | |
tree | a24fc20865f65772f530d16177520190594ffdd2 /kcoloredit | |
parent | eecec9afb81fdebb0f22e9da22635874c403f854 (diff) | |
download | tdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.tar.gz tdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.zip |
TQt4 port kdegraphics
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1237557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcoloredit')
28 files changed, 160 insertions, 148 deletions
diff --git a/kcoloredit/colorselector.cpp b/kcoloredit/colorselector.cpp index 50288313..af209147 100644 --- a/kcoloredit/colorselector.cpp +++ b/kcoloredit/colorselector.cpp @@ -30,7 +30,7 @@ #include "texteditselection.h" #include "colorselector.h" -ColorSelector::ColorSelector(TQWidget *parent, const char *name ) : TQWidget(parent, name) { +ColorSelector::ColorSelector(TQWidget *tqparent, const char *name ) : TQWidget(tqparent, name) { fComponentsMode = false; TQVBoxLayout* topLayout = new TQVBoxLayout(this, 4); /* @@ -53,7 +53,7 @@ ColorSelector::ColorSelector(TQWidget *parent, const char *name ) : TQWidget(par topLayout->addWidget(gradientSelection, 10); KSeparator* hLine = new KSeparator(KSeparator::HLine, this); topLayout->addWidget(hLine); - TQHBoxLayout* layout = new TQHBoxLayout(); + TQHBoxLayout* tqlayout = new TQHBoxLayout(); TextEditSelection* textEditSelection = new TextEditSelection(this); connect(textEditSelection, TQT_SIGNAL( valueChanged(Color*) ), TQT_SLOT( slotSetColor(Color*) )); connect(this, TQT_SIGNAL( valueChanged(Color*) ), textEditSelection, TQT_SLOT( slotSetValue(Color*) )); @@ -73,7 +73,7 @@ ColorSelector::ColorSelector(TQWidget *parent, const char *name ) : TQWidget(par TQVBoxLayout* colorChangeSliderLayout = new TQVBoxLayout(colorChangeSliderWidget, 1); colorChangeSliderLayout->setMargin(0); TQSlider* colorChangeSlider = new TQSlider(0, MAX_COLOR_CHANGE_VALUE, - MAX_COLOR_CHANGE_VALUE/4, colorChangeValue, TQSlider::Horizontal, colorChangeSliderWidget); + MAX_COLOR_CHANGE_VALUE/4, colorChangeValue, Qt::Horizontal, colorChangeSliderWidget); colorChangeSlider->setTickInterval(colorChangeSlider->pageStep()); colorChangeSlider->setTickmarks(TQSlider::Above); connect(colorChangeSlider, TQT_SIGNAL( valueChanged(int) ), TQT_SLOT( slotColorChangeValueChanged(int) )); @@ -88,17 +88,17 @@ ColorSelector::ColorSelector(TQWidget *parent, const char *name ) : TQWidget(par colorChangeLayout->addStretch(10); colorChangeLayout->addWidget(colorChangeSliderWidget); colorChangeLayout->addStretch(10); - layout->addLayout(colorChangeLayout, 10); + tqlayout->addLayout(colorChangeLayout, 10); m_color.setComponents(RGB_MAX_COMPONENT_VALUE, RGB_MAX_COMPONENT_VALUE, RGB_MAX_COMPONENT_VALUE); slotColorReplace(); KSeparator* vLine = new KSeparator(KSeparator::VLine, this); - layout->addWidget(vLine); - layout->addWidget(textEditSelection, 1); + tqlayout->addWidget(vLine); + tqlayout->addWidget(textEditSelection, 1); colorPatch = new KColorPatch(this); connect(colorPatch, TQT_SIGNAL( colorChanged(const TQColor&) ), TQT_SLOT( slotSetColor(const TQColor&) )); colorPatch->setMinimumSize(80, 64); - layout->addWidget(colorPatch, 10); - topLayout->addLayout(layout); + tqlayout->addWidget(colorPatch, 10); + topLayout->addLayout(tqlayout); } ColorSelector::~ColorSelector() { } diff --git a/kcoloredit/colorselector.h b/kcoloredit/colorselector.h index 72d62ef6..5c3d9b62 100644 --- a/kcoloredit/colorselector.h +++ b/kcoloredit/colorselector.h @@ -31,10 +31,11 @@ */ class ColorSelector : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** constructs a color selector widget */ - ColorSelector(TQWidget *parent=0, const char *name=0); + ColorSelector(TQWidget *tqparent=0, const char *name=0); ~ColorSelector(); /** @return the selected color */ const Color& color(); diff --git a/kcoloredit/editablestreamhistory.h b/kcoloredit/editablestreamhistory.h index 9fe59d99..20233e33 100644 --- a/kcoloredit/editablestreamhistory.h +++ b/kcoloredit/editablestreamhistory.h @@ -37,7 +37,7 @@ public: /** Pastes a stream at index. Uses undo/redo history */ void paste(const int index, EDITABLE_STREAM& pasteStream); /** Replaces a stream at index. Uses undo/redo history */ - void replace(const int index, EDITABLE_STREAM& replaceStream); + void tqreplace(const int index, EDITABLE_STREAM& replaceStream); /** @return Whether undo possible */ bool undoPossible(); /** @return Whether redo possible */ @@ -76,7 +76,7 @@ template <class EDITABLE_STREAM> void } template <class EDITABLE_STREAM> void - EditableStreamHistory<EDITABLE_STREAM>::replace(const int index, EDITABLE_STREAM& replaceStream) { + EditableStreamHistory<EDITABLE_STREAM>::tqreplace(const int index, EDITABLE_STREAM& replaceStream) { m_editableStream->cut(index, replaceStream.length()); m_editableStream->paste(index, replaceStream); } diff --git a/kcoloredit/gradientselection.cpp b/kcoloredit/gradientselection.cpp index f75547c1..72dd02cd 100644 --- a/kcoloredit/gradientselection.cpp +++ b/kcoloredit/gradientselection.cpp @@ -24,15 +24,15 @@ #include "main.h" #include "gradientselection.h" -GradientSelection::GradientSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) { +GradientSelection::GradientSelection(TQWidget *tqparent, const char *name ) : TQWidget(tqparent,name) { TQGridLayout* topLayout = new TQGridLayout(this, 2, 2, 0); - TQHBoxLayout* layout = new TQHBoxLayout(0); - layout->setMargin(3); + TQHBoxLayout* tqlayout = new TQHBoxLayout(0); + tqlayout->setMargin(3); xyColorSelector = new KXYColorSelector(this); connect(xyColorSelector, TQT_SIGNAL( valueChanged(int, int) ), TQT_SLOT( slotXyColorSelectorPosChanged(int, int) )); - layout->addWidget(xyColorSelector); - topLayout->addLayout(layout, 0, 0); + tqlayout->addWidget(xyColorSelector); + topLayout->addLayout(tqlayout, 0, 0); topLayout->setRowStretch(0, 10); topLayout->setRowStretch(1, 0); TQVBoxLayout* xyColorSelectorLayout = new TQVBoxLayout(); @@ -54,7 +54,7 @@ GradientSelection::GradientSelection(TQWidget *parent, const char *name ) : TQWi xyColorSelectorLayout->addLayout(buttonsLayout); xyColorSelectorLayout->addSpacing(2); topLayout->addLayout(xyColorSelectorLayout, 1, 0); - zColorSelector = new KZColorSelector(KZColorSelector::Vertical, this); + zColorSelector = new KZColorSelector(Qt::Vertical, this); connect(zColorSelector, TQT_SIGNAL( valueChanged(int) ), TQT_SLOT( slotZColorSelectorPosChanged(int) )); zColorSelector->setFixedWidth(36); @@ -218,7 +218,7 @@ void GradientSelection::slotXyColorSelectorPosChanged(int x, int y) { } void GradientSelection::slotZColorSelectorPosChanged(int y) { - bool repaintZColorSelector = false; + bool tqrepaintZColorSelector = false; switch(zColorSelectorComponentIndex) { case H_COMPONENT: hComponent = y; @@ -237,7 +237,7 @@ void GradientSelection::slotZColorSelectorPosChanged(int y) { rgbColor.setHsv(hComponent, sComponent, vComponent); color.setComponents(rgbColor.red(), rgbColor.green(), rgbColor.blue()); updateXyColorSelector(false); - if(repaintZColorSelector) + if(tqrepaintZColorSelector) updateZColorSelector(); emit valueChanged(&color); } diff --git a/kcoloredit/gradientselection.h b/kcoloredit/gradientselection.h index 0197f706..e3e58d1c 100644 --- a/kcoloredit/gradientselection.h +++ b/kcoloredit/gradientselection.h @@ -32,10 +32,11 @@ */ class GradientSelection : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** Constructs the widget */ - GradientSelection(TQWidget *parent=0, const char *name=0); + GradientSelection(TQWidget *tqparent=0, const char *name=0); ~GradientSelection(); /** Enables or disables the color synchronize button */ void enableSynchronizeColorButton(bool enable); diff --git a/kcoloredit/imageselection.cpp b/kcoloredit/imageselection.cpp index b6d47c47..a82bdfdb 100644 --- a/kcoloredit/imageselection.cpp +++ b/kcoloredit/imageselection.cpp @@ -17,7 +17,7 @@ #include "imageselection.h" -ImageSelection::ImageSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) { +ImageSelection::ImageSelection(TQWidget *tqparent, const char *name ) : TQWidget(tqparent,name) { } ImageSelection::~ImageSelection(){ } diff --git a/kcoloredit/imageselection.h b/kcoloredit/imageselection.h index dd6a9364..a773cdcc 100644 --- a/kcoloredit/imageselection.h +++ b/kcoloredit/imageselection.h @@ -27,10 +27,11 @@ */ class ImageSelection : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** constructs the widget */ - ImageSelection(TQWidget *parent=0, const char *name=0); + ImageSelection(TQWidget *tqparent=0, const char *name=0); ~ImageSelection(); signals: diff --git a/kcoloredit/kcolorchooser.cpp b/kcoloredit/kcolorchooser.cpp index cbd5292b..455e9e16 100644 --- a/kcoloredit/kcolorchooser.cpp +++ b/kcoloredit/kcolorchooser.cpp @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) KColorDialog dlg; - dlg.setColor(Qt::blue); // Just a color + dlg.setColor(TQt::blue); // Just a color app.connect(&dlg, TQT_SIGNAL(finished()), TQT_SLOT(quit())); @@ -65,6 +65,6 @@ int main(int argc, char *argv[]) KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); const TQColor c = dlg.color(); if ( args->isSet("print") && c.isValid() ) { - std::cout << c.name().utf8().data() << std::endl; + std::cout << TQString(c.name()).utf8().data() << std::endl; } } diff --git a/kcoloredit/kcoloredit.cpp b/kcoloredit/kcoloredit.cpp index 9b093722..5b0dffb9 100644 --- a/kcoloredit/kcoloredit.cpp +++ b/kcoloredit/kcoloredit.cpp @@ -64,39 +64,39 @@ KColorEditApp::~KColorEditApp() { void KColorEditApp::initActions() { // File actiojns - KStdAction::openNew( this, TQT_SLOT( slotFileNew() ), actionCollection() ); - KStdAction::open( this, TQT_SLOT( slotFileOpen() ), actionCollection() ); - KStdAction::saveAs( this, TQT_SLOT( slotFileSaveAs() ), actionCollection() ); - KStdAction::close( this, TQT_SLOT( slotClose() ), actionCollection() ); - KStdAction::quit( this, TQT_SLOT( slotQuit() ), actionCollection() ); - m_actSave = KStdAction::save( this, TQT_SLOT( slotFileSave() ), + KStdAction::openNew( TQT_TQOBJECT(this), TQT_SLOT( slotFileNew() ), actionCollection() ); + KStdAction::open( TQT_TQOBJECT(this), TQT_SLOT( slotFileOpen() ), actionCollection() ); + KStdAction::saveAs( TQT_TQOBJECT(this), TQT_SLOT( slotFileSaveAs() ), actionCollection() ); + KStdAction::close( TQT_TQOBJECT(this), TQT_SLOT( slotClose() ), actionCollection() ); + KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT( slotQuit() ), actionCollection() ); + m_actSave = KStdAction::save( TQT_TQOBJECT(this), TQT_SLOT( slotFileSave() ), actionCollection() ); - m_actRecent = KStdAction::openRecent( this, + m_actRecent = KStdAction::openRecent( TQT_TQOBJECT(this), TQT_SLOT( slotFileOpenRecent( const KURL& ) ), actionCollection() ); ( void ) new KAction( i18n("New &Window"), kapp->miniIcon(), KShortcut(), - this, TQT_SLOT( slotFileNewWindow() ), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT( slotFileNewWindow() ), actionCollection(), "file_new_window" ); // Edit actions - m_actCut = KStdAction::cut( this, TQT_SLOT( slotEditCut() ), + m_actCut = KStdAction::cut( TQT_TQOBJECT(this), TQT_SLOT( slotEditCut() ), actionCollection() ); - m_actCopy = KStdAction::copy( this, TQT_SLOT( slotEditCopy() ), + m_actCopy = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( slotEditCopy() ), actionCollection() ); - m_actPaste = KStdAction::paste( this, TQT_SLOT( slotEditPaste() ), + m_actPaste = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT( slotEditPaste() ), actionCollection() ); m_actPaste->setEnabled( false ); // Color Menu - m_actNames = new KToggleAction( i18n("Show &Color Names"), KShortcut(), this, + m_actNames = new KToggleAction( i18n("Show &Color Names"), KShortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotViewColorNames() ), actionCollection(), "color_view_names" ); m_actNames->setCheckedState(i18n("Hide &Color Names")); - m_actPalette = new KAction( i18n("From &Palette"), KShortcut(), this, + m_actPalette = new KAction( i18n("From &Palette"), KShortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotColorFromPalette() ), actionCollection(), "color_from_palette" ); - ( void ) new KAction( i18n("From &Screen"), KShortcut(), this, + ( void ) new KAction( i18n("From &Screen"), KShortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotColorFromScreen() ), actionCollection(), "color_from_screen" ); } @@ -104,7 +104,7 @@ void KColorEditApp::initActions() void KColorEditApp::initStatusBar() { statusBar()->insertItem(i18n("Ready."), ID_STATUS_MSG, 1); - statusBar()->setItemAlignment( ID_STATUS_MSG, Qt::AlignLeft ); + statusBar()->setItemAlignment( ID_STATUS_MSG, TQt::AlignLeft ); } void KColorEditApp::initDocument() diff --git a/kcoloredit/kcoloredit.h b/kcoloredit/kcoloredit.h index e30fff18..e09fd415 100644 --- a/kcoloredit/kcoloredit.h +++ b/kcoloredit/kcoloredit.h @@ -21,7 +21,7 @@ #include <config.h> -// include files for Qt +// include files for TQt #include <tqevent.h> #include <tqstringlist.h> @@ -54,6 +54,7 @@ class KColorEditView; class KColorEditApp : public KMainWindow { Q_OBJECT + TQ_OBJECT friend class KColorEditView; @@ -73,7 +74,7 @@ class KColorEditApp : public KMainWindow KColorEditDoc *document() const; protected: - /** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration + /** save general Options like all bar positions and status as well as the tqgeometry and the recent file list to the configuration * file */ void saveOptions(); diff --git a/kcoloredit/kcoloreditdoc.cpp b/kcoloredit/kcoloreditdoc.cpp index ea9a0433..ed9094e5 100644 --- a/kcoloredit/kcoloreditdoc.cpp +++ b/kcoloredit/kcoloreditdoc.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -// include files for Qt +// include files for TQt #include <tqdir.h> #include <tqfileinfo.h> #include <tqwidget.h> @@ -31,7 +31,7 @@ #include "kcoloreditview.h" #include "resource.h" -KColorEditDoc::KColorEditDoc(TQWidget *parent, const char *name) : TQObject(parent, name), +KColorEditDoc::KColorEditDoc(TQWidget *tqparent, const char *name) : TQObject(tqparent, name), m_palette(), m_paletteHistory(&m_palette, 0) { m_pViewList = new TQPtrList<KColorEditView>(); m_pViewList->setAutoDelete(true); @@ -106,10 +106,10 @@ bool KColorEditDoc::saveModified() if(m_modified) { - KColorEditApp *window=(KColorEditApp *) parent(); + KColorEditApp *window=(KColorEditApp *) tqparent(); int want_save = KMessageBox::warningYesNoCancel(window, i18n("The current file has been modified.\n" - "Do you want to save it?"), TQString::null, KStdGuiItem::save(), i18n("Do Not Save")); + "Do you want to save it?"), TQString(), KStdGuiItem::save(), i18n("Do Not Save")); switch(want_save) { case KMessageBox::Yes: @@ -175,7 +175,7 @@ bool KColorEditDoc::openDocument(const TQString& filename) { setPaletteCursorPos(m_palette.length()); setPaletteSelection(0, 0); slotRedrawAllViews(0, true); - KColorEditApp *window=(KColorEditApp*)parent(); + KColorEditApp *window=(KColorEditApp*)tqparent(); window->setCaption(m_title); } return true; @@ -235,7 +235,7 @@ void KColorEditDoc::copyToClipboard(Palette& palette) { TQString text; TQTextOStream stream(&text); palette.save(stream, 0, false); - KApplication::clipboard()->setText(text); + KApplication::tqclipboard()->setText(text); emit clipboardChanged(); } @@ -260,7 +260,7 @@ void KColorEditDoc::paste() { Palette palettePaste; TQString text; TQTextIStream stream(&text); - text = KApplication::clipboard()->text(); + text = KApplication::tqclipboard()->text(); if(palettePaste.load( stream, false )) { m_paletteHistory.paste(paletteCursorPos(), palettePaste); setPaletteSelection(paletteCursorPos(), paletteCursorPos() + @@ -281,11 +281,11 @@ void KColorEditDoc::insert(int index, const Color& color) { slotRedrawAllViews(0); } -void KColorEditDoc::replace(int index, const Color& color) { +void KColorEditDoc::tqreplace(int index, const Color& color) { Palette paletteReplace; Color* replaceColor = new Color(color); paletteReplace.append(replaceColor); - m_paletteHistory.replace(index, paletteReplace); + m_paletteHistory.tqreplace(index, paletteReplace); setPaletteSelection(0, 0); setModified(true); slotRedrawAllViews(0); diff --git a/kcoloredit/kcoloreditdoc.h b/kcoloredit/kcoloreditdoc.h index 03d5ce70..108e05fe 100644 --- a/kcoloredit/kcoloreditdoc.h +++ b/kcoloredit/kcoloreditdoc.h @@ -44,13 +44,14 @@ class KColorEditView; * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team. * @version KDevelop version 0.4 code generation */ -class KColorEditDoc : public QObject +class KColorEditDoc : public TQObject { Q_OBJECT + TQ_OBJECT public: /** Constructor for the fileclass of the application */ - KColorEditDoc(TQWidget *parent, const char *name=0); + KColorEditDoc(TQWidget *tqparent, const char *name=0); /** Destructor for the fileclass of the application */ ~KColorEditDoc(); @@ -111,7 +112,7 @@ class KColorEditDoc : public QObject /** Inserts a color at index */ void insert(int index, const Color& color); /** Replaces a color at index */ - void replace(int index, const Color& color); + void tqreplace(int index, const Color& color); protected: /** Sets an error string if an IO operation was unsuccesfull */ diff --git a/kcoloredit/kcoloreditview.cpp b/kcoloredit/kcoloreditview.cpp index 10484fe8..1abfd861 100644 --- a/kcoloredit/kcoloreditview.cpp +++ b/kcoloredit/kcoloreditview.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -// include files for Qt +// include files for TQt #include <tqpainter.h> #include <tqlayout.h> #include <tqpushbutton.h> @@ -35,7 +35,7 @@ #include "kcoloredit.h" #include "palette.h" -KColorEditView::KColorEditView(TQWidget *parent, const char *name) : TQSplitter(parent, name) { +KColorEditView::KColorEditView(TQWidget *tqparent, const char *name) : TQSplitter(tqparent, name) { colorSelector = new ColorSelector(this); colorSelector->slotSetColor( Color( RGB_MAX_COMPONENT_VALUE, RGB_MAX_COMPONENT_VALUE, RGB_MAX_COMPONENT_VALUE, "" )); @@ -43,7 +43,7 @@ KColorEditView::KColorEditView(TQWidget *parent, const char *name) : TQSplitter( TQVBoxLayout* paletteLayout = new TQVBoxLayout(paletteViewArea); paletteView = new PaletteView(16, 16, 2, this, paletteViewArea); paletteLayout->addWidget(paletteView, 10); - TQHBoxLayout* layout = new TQHBoxLayout(); + TQHBoxLayout* tqlayout = new TQHBoxLayout(); TQVBoxLayout* addColorLayout = new TQVBoxLayout(4); addColorLayout->setMargin(8); TQHBoxLayout* buttonsLayout = new TQHBoxLayout(4); @@ -70,7 +70,7 @@ KColorEditView::KColorEditView(TQWidget *parent, const char *name) : TQSplitter( // paletteView, TQT_SLOT( slotCursorFollowsChosenColor(bool) )); //cursorFollowsChosenColor->toggle(); paletteView->slotCursorFollowsChosenColor(true); - layout->addLayout(addColorLayout, 0); + tqlayout->addLayout(addColorLayout, 0); TQVGroupBox* colorAtCursorFrame = new TQVGroupBox(i18n("Color at Cursor"), paletteViewArea); TQWidget* colorAtCursorFrameArea = new TQWidget(colorAtCursorFrame); TQVBoxLayout* colorAtCursorLayout = new TQVBoxLayout(colorAtCursorFrameArea, 4); @@ -127,10 +127,10 @@ KColorEditView::KColorEditView(TQWidget *parent, const char *name) : TQSplitter( colorAtCursorRgbStringLayout->addWidget(colorAtCursorRgbStringValueLabel); colorAtCursorRgbStringLayout->addStretch(); colorAtCursorLayout->addLayout(colorAtCursorRgbStringLayout); - layout->addWidget(colorAtCursorFrame, 10); - layout->addSpacing(8); + tqlayout->addWidget(colorAtCursorFrame, 10); + tqlayout->addSpacing(8); paletteLayout->addSpacing(4); - paletteLayout->addLayout(layout); + paletteLayout->addLayout(tqlayout); paletteLayout->addSpacing(4); inColorNameChanging = false; doNotUpdateColorLabels = false; @@ -145,7 +145,7 @@ void KColorEditView::setColorAtCursorComponentValueLabelSizes(TQLabel* const lab } KColorEditDoc *KColorEditView::document() const { - KColorEditApp *theApp=(KColorEditApp *) parentWidget(); + KColorEditApp *theApp=(KColorEditApp *) tqparentWidget(); return theApp->document(); } @@ -234,7 +234,7 @@ void KColorEditView::slotAddColor() { case REPLACE_COLOR: if(index < palette->length()) - document()->replace(index, color); + document()->tqreplace(index, color); else document()->insert(index, color); break; @@ -274,7 +274,7 @@ void KColorEditView::slotSetColorName(const TQString& name) { palette->color(cursorPos)->component(Color::BLUE_INDEX), name); doNotUpdateColorLabels = true; - document()->replace(cursorPos, newColor); + document()->tqreplace(cursorPos, newColor); doNotUpdateColorLabels = false; } } diff --git a/kcoloredit/kcoloreditview.h b/kcoloredit/kcoloreditview.h index 0bc2a569..1ede4427 100644 --- a/kcoloredit/kcoloreditview.h +++ b/kcoloredit/kcoloreditview.h @@ -22,7 +22,7 @@ #include <config.h> #endif -// include files for Qt +// include files for TQt #include <tqsplitter.h> #include <tqcheckbox.h> #include <tqlabel.h> @@ -43,14 +43,15 @@ class KColorEditDoc; */ class KColorEditView : public TQSplitter { Q_OBJECT + TQ_OBJECT public: /** Constructor for the main view */ - KColorEditView(TQWidget *parent = 0, const char *name = 0); + KColorEditView(TQWidget *tqparent = 0, const char *name = 0); /** Destructor for the main view */ ~KColorEditView(); - /** returns a pointer to the document connected to the view instance. Mind that this method requires a KColorEditApp instance as a parent + /** returns a pointer to the document connected to the view instance. Mind that this method requires a KColorEditApp instance as a tqparent * widget to get to the window document pointer by calling the KColorEditApp::getDocument() method. * * @see KColorEditApp#getDocument diff --git a/kcoloredit/kxycolorselector.cpp b/kcoloredit/kxycolorselector.cpp index 4a717c5e..bcd58f00 100644 --- a/kcoloredit/kxycolorselector.cpp +++ b/kcoloredit/kxycolorselector.cpp @@ -23,7 +23,7 @@ #include "kxycolorselector.h" -KXYColorSelector::KXYColorSelector(TQWidget *parent, const char *name) : KXYSelector(parent,name) { +KXYColorSelector::KXYColorSelector(TQWidget *tqparent, const char *name) : KXYSelector(tqparent,name) { setBackgroundMode(NoBackground); setRange(0, 0, COMPONENT_SELECTION_RESOLUTION - 1, COMPONENT_SELECTION_RESOLUTION - 1); setType(TYPE_NONE); @@ -42,7 +42,7 @@ void KXYColorSelector::setType(const int type) { void KXYColorSelector::updateContents() { drawPalette(&pixmap); - repaint(); + tqrepaint(); } void KXYColorSelector::resizeEvent(TQResizeEvent*) { @@ -70,9 +70,9 @@ void KXYColorSelector::drawCursor(TQPainter* painter, int x, int y) { TQColor cursorColor; if(( 2*color.red() + 4*color.green() + 1*color.blue() )*1.0/ ( 2*255 + 4*255 + 1*255 ) > 0.65) - cursorColor = Qt::black; + cursorColor = TQt::black; else - cursorColor = Qt::white; + cursorColor = TQt::white; painter->setPen(TQPen( cursorColor )); const int lineBegin = 2; const int lineEnd = 6; @@ -132,25 +132,25 @@ void KXYColorSelector::setColor(TQColor* const color, const int x, const int y) } TQColor* KXYColorSelector::standardColorsPalette() { - TQColor* palette = new QColor[STANDARD_PALETTE_SIZE]; + TQColor* palette = new TQColor[STANDARD_PALETTE_SIZE]; int i = 0; - palette[i++] = Qt::red; - palette[i++] = Qt::green; - palette[i++] = Qt::blue; - palette[i++] = Qt::cyan; - palette[i++] = Qt::magenta; - palette[i++] = Qt::yellow; - palette[i++] = Qt::darkRed; - palette[i++] = Qt::darkGreen; - palette[i++] = Qt::darkBlue; - palette[i++] = Qt::darkCyan; - palette[i++] = Qt::darkMagenta; - palette[i++] = Qt::darkYellow; - palette[i++] = Qt::white; - palette[i++] = Qt::lightGray; - palette[i++] = Qt::gray; - palette[i++] = Qt::darkGray; - palette[i++] = Qt::black; + palette[i++] = TQt::red; + palette[i++] = TQt::green; + palette[i++] = TQt::blue; + palette[i++] = TQt::cyan; + palette[i++] = TQt::magenta; + palette[i++] = TQt::yellow; + palette[i++] = TQt::darkRed; + palette[i++] = TQt::darkGreen; + palette[i++] = TQt::darkBlue; + palette[i++] = TQt::darkCyan; + palette[i++] = TQt::darkMagenta; + palette[i++] = TQt::darkYellow; + palette[i++] = TQt::white; + palette[i++] = TQt::lightGray; + palette[i++] = TQt::gray; + palette[i++] = TQt::darkGray; + palette[i++] = TQt::black; return palette; } diff --git a/kcoloredit/kxycolorselector.h b/kcoloredit/kxycolorselector.h index 6225d74f..263a39f3 100644 --- a/kcoloredit/kxycolorselector.h +++ b/kcoloredit/kxycolorselector.h @@ -28,6 +28,7 @@ */ class KXYColorSelector : public KXYSelector { Q_OBJECT + TQ_OBJECT public: /** The types of the selector. They specify a color component subset */ @@ -46,7 +47,7 @@ public: /** Constructs a two-dimensional color component selector widget, * with a type TYPE_NONE and ranges 0 .. MAX_COLOR_COMPONENT_VALUE */ - KXYColorSelector(TQWidget *parent=0, const char *name=0); + KXYColorSelector(TQWidget *tqparent=0, const char *name=0); ~KXYColorSelector(); /** Set the type of the selector */ void setType(const int type); diff --git a/kcoloredit/kzcolorselector.cpp b/kcoloredit/kzcolorselector.cpp index b00991a2..b0f7914a 100644 --- a/kcoloredit/kzcolorselector.cpp +++ b/kcoloredit/kzcolorselector.cpp @@ -23,8 +23,8 @@ #include "main.h" #include "kzcolorselector.h" -KZColorSelector::KZColorSelector(Orientation o, TQWidget *parent, const char *name) : - KSelector(o, parent, name) { +KZColorSelector::KZColorSelector(Qt::Orientation o, TQWidget *tqparent, const char *name) : + KSelector(o, tqparent, name) { baseColorH = -1; baseColorS = 0; baseColorV = 0; @@ -53,7 +53,7 @@ void KZColorSelector::setType(const int type) { void KZColorSelector::updateContents() { drawPalette(&pixmap); - repaint(false); + tqrepaint(false); } void KZColorSelector::resizeEvent(TQResizeEvent*) { @@ -119,25 +119,25 @@ void KZColorSelector::setColor(TQColor* const color, const int y) { } TQColor* KZColorSelector::getStandardColorsPalette() { - TQColor* palette = new QColor[( int )STANDARD_PALETTE_SIZE]; + TQColor* palette = new TQColor[( int )STANDARD_PALETTE_SIZE]; int i = 0; - palette[i++] = Qt::red; - palette[i++] = Qt::green; - palette[i++] = Qt::blue; - palette[i++] = Qt::cyan; - palette[i++] = Qt::magenta; - palette[i++] = Qt::yellow; - palette[i++] = Qt::darkRed; - palette[i++] = Qt::darkGreen; - palette[i++] = Qt::darkBlue; - palette[i++] = Qt::darkCyan; - palette[i++] = Qt::darkMagenta; - palette[i++] = Qt::darkYellow; - palette[i++] = Qt::white; - palette[i++] = Qt::lightGray; - palette[i++] = Qt::gray; - palette[i++] = Qt::darkGray; - palette[i++] = Qt::black; + palette[i++] = TQt::red; + palette[i++] = TQt::green; + palette[i++] = TQt::blue; + palette[i++] = TQt::cyan; + palette[i++] = TQt::magenta; + palette[i++] = TQt::yellow; + palette[i++] = TQt::darkRed; + palette[i++] = TQt::darkGreen; + palette[i++] = TQt::darkBlue; + palette[i++] = TQt::darkCyan; + palette[i++] = TQt::darkMagenta; + palette[i++] = TQt::darkYellow; + palette[i++] = TQt::white; + palette[i++] = TQt::lightGray; + palette[i++] = TQt::gray; + palette[i++] = TQt::darkGray; + palette[i++] = TQt::black; return palette; } diff --git a/kcoloredit/kzcolorselector.h b/kcoloredit/kzcolorselector.h index 60e32f0a..f226d744 100644 --- a/kcoloredit/kzcolorselector.h +++ b/kcoloredit/kzcolorselector.h @@ -29,6 +29,7 @@ */ class KZColorSelector : public KSelector { Q_OBJECT + TQ_OBJECT public: /** Selector type constants */ @@ -37,7 +38,7 @@ public: TYPE_V = 2 }; /** Constructs the widget */ - KZColorSelector(Orientation o, TQWidget *parent=0, const char *name=0); + KZColorSelector(Qt::Orientation o, TQWidget *tqparent=0, const char *name=0); ~KZColorSelector(); /** Sets the selector type */ void setType(const int type); diff --git a/kcoloredit/loadpalettedlg.cpp b/kcoloredit/loadpalettedlg.cpp index 23def4d5..a5e298ce 100644 --- a/kcoloredit/loadpalettedlg.cpp +++ b/kcoloredit/loadpalettedlg.cpp @@ -31,8 +31,8 @@ #include "palette.h" #include "loadpalettedlg.h" -LoadPaletteDlg::LoadPaletteDlg(TQWidget *parent, const char *name) - : KDialogBase(parent, name, true, i18n( "Load Palette" ), +LoadPaletteDlg::LoadPaletteDlg(TQWidget *tqparent, const char *name) + : KDialogBase(tqparent, name, true, i18n( "Load Palette" ), Ok|Cancel, Ok, true) { fileName = ""; TQWidget *mainWidget = new TQWidget( this ); @@ -45,7 +45,7 @@ LoadPaletteDlg::LoadPaletteDlg(TQWidget *parent, const char *name) TQStringList palettesList = Palette::kdePalettes(); for(TQStringList::Iterator palette = palettesList.begin(); palette != palettesList.end(); ++palette) { - bool prepend = (*palette).contains( "colors/Custom_Colors" ); + bool prepend = (*palette).tqcontains( "colors/Custom_Colors" ); TQString fileName = locate("config", (*palette)); if(prepend) { palettesFileNames.prepend(fileName); diff --git a/kcoloredit/loadpalettedlg.h b/kcoloredit/loadpalettedlg.h index f7dd50cb..7e71e2f5 100644 --- a/kcoloredit/loadpalettedlg.h +++ b/kcoloredit/loadpalettedlg.h @@ -27,11 +27,12 @@ */ class LoadPaletteDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: /** constructs the dialog */ - LoadPaletteDlg(TQWidget *parent = 0, const char *name = 0); + LoadPaletteDlg(TQWidget *tqparent = 0, const char *name = 0); ~LoadPaletteDlg(); /** @return the fetched file name */ diff --git a/kcoloredit/palette.cpp b/kcoloredit/palette.cpp index 42758b41..6f830278 100644 --- a/kcoloredit/palette.cpp +++ b/kcoloredit/palette.cpp @@ -108,14 +108,14 @@ bool Palette::load(TQTextStream& stream, bool loadName /* = true */) { int lineNum = 0; while (!stream.atEnd()) { TQString string = stream.readLine().append(' '); - if(string.find( TQRegExp("[^\\s]") ) == -1 || + if(string.tqfind( TQRegExp("[^\\s]") ) == -1 || string.stripWhiteSpace().at( 0 ) == '#' || ( loadName && lineNum == 0 )) { if(loadName && lineNum == 0) setName(string.stripWhiteSpace()); } else { Color* newColor = new Color(); - int position = string.find(TQRegExp( "[^\\s]" )); + int position = string.tqfind(TQRegExp( "[^\\s]" )); for(int componentIndex = 0; componentIndex < Color::COMPONENTS_NUM; ++componentIndex) { if(position == -1) { @@ -123,7 +123,7 @@ bool Palette::load(TQTextStream& stream, bool loadName /* = true */) { result = false; break; } - int endPosition = string.find(TQRegExp( "\\s" ), position); + int endPosition = string.tqfind(TQRegExp( "\\s" ), position); if(endPosition == -1) { m_errorString = i18n("Invalid format"); result = false; @@ -139,7 +139,7 @@ bool Palette::load(TQTextStream& stream, bool loadName /* = true */) { break; } newColor->setComponent(componentIndex, componentValue); - position = string.find(TQRegExp( "[^\\s]" ), endPosition); + position = string.tqfind(TQRegExp( "[^\\s]" ), endPosition); } if(!result) { delete newColor; diff --git a/kcoloredit/paletteview.cpp b/kcoloredit/paletteview.cpp index 6648d88b..d62ec43f 100644 --- a/kcoloredit/paletteview.cpp +++ b/kcoloredit/paletteview.cpp @@ -21,8 +21,8 @@ #include "paletteview.h" PaletteView::PaletteView(const int defaultCellWidth, const int defaultCellHeight, const int cellSpacing, - KColorEditView* view, TQWidget *parent, const char *name) : - TQFrame(parent, name, TQWidget::WResizeNoErase*0) { + KColorEditView* view, TQWidget *tqparent, const char *name) : + TQFrame(tqparent, name, TQWidget::WResizeNoErase*0) { setFrameStyle(StyledPanel|Sunken); setLineWidth(2); TQGridLayout* topLayout = new TQGridLayout(this, 2, 2); @@ -32,7 +32,7 @@ PaletteView::PaletteView(const int defaultCellWidth, const int defaultCellHeight topLayout->setColStretch(0, 10); topLayout->setColStretch(1, 0); scrollBar = new TQScrollBar(this); - hScrollBar = new TQScrollBar(0, 1, 1, 1, 0, TQScrollBar::Horizontal, this); + hScrollBar = new TQScrollBar(0, 1, 1, 1, 0, Qt::Horizontal, this); scrolledArea = new PaletteViewScrolledArea(defaultCellWidth, defaultCellHeight, cellSpacing, scrollBar, hScrollBar, view, this); connect(scrollBar, TQT_SIGNAL( valueChanged(int) ), diff --git a/kcoloredit/paletteview.h b/kcoloredit/paletteview.h index 9501de40..cc1e56b8 100644 --- a/kcoloredit/paletteview.h +++ b/kcoloredit/paletteview.h @@ -26,18 +26,19 @@ class KColorEditView; /** This is a Palette class view widget. - * Its parent is KColorEditView + * Its tqparent is KColorEditView * @author Artur Rataj */ class PaletteView : public TQFrame { Q_OBJECT + TQ_OBJECT public: /** Constructs a palette view widget, with a default cells sizes and spacing. * The effective cell sizes may be adjusted to fit the widget sizes. */ PaletteView(const int defaultCellWidth, const int defaultCellHeight, const int cellSpacing, - KColorEditView* view, TQWidget *parent = 0, const char *name=0); + KColorEditView* view, TQWidget *tqparent = 0, const char *name=0); ~PaletteView(); /** Calls redraw() in scrolledArea */ void redraw(); diff --git a/kcoloredit/paletteviewscrolledarea.cpp b/kcoloredit/paletteviewscrolledarea.cpp index 0b4f0ec4..e6d26a20 100644 --- a/kcoloredit/paletteviewscrolledarea.cpp +++ b/kcoloredit/paletteviewscrolledarea.cpp @@ -38,8 +38,8 @@ PaletteViewScrolledArea::PaletteViewScrolledArea(const int defaultCellWidth, const int defaultCellHeight, const int cellSpacing, TQScrollBar* scrollBar, - TQScrollBar* hScrollBar, KColorEditView* view, TQWidget* parent, const char* name) - : TQFrame(parent, name) { + TQScrollBar* hScrollBar, KColorEditView* view, TQWidget* tqparent, const char* name) + : TQFrame(tqparent, name) { this->defaultCellWidth = defaultCellWidth; this->defaultCellHeight = defaultCellHeight; this->cellSpacing = cellSpacing; @@ -73,11 +73,11 @@ void PaletteViewScrolledArea::slotViewColorNames(bool viewColorNames) { void PaletteViewScrolledArea::redraw() { //setCellsSizes(); - repaintPalette(); + tqrepaintPalette(); } -void PaletteViewScrolledArea::repaintPalette() { - repaint(false); +void PaletteViewScrolledArea::tqrepaintPalette() { + tqrepaint(false); } void PaletteViewScrolledArea::checkSelectionAutoScroll(const int mousePosY) { @@ -106,7 +106,7 @@ void PaletteViewScrolledArea::slotScrollTimeout() { else setSelection(selectionEnd, selectionBegin); checkSelectionAutoScroll(cursorPoint.y()); - repaintPalette(); + tqrepaintPalette(); } } @@ -220,7 +220,7 @@ void PaletteViewScrolledArea::paintEvent(TQPaintEvent* /*event*/) { setCellsSizes(); TQPixmap pixmap(size()); TQPainter painter; - painter.begin(&pixmap, this); + painter.tqbegin(TQT_TQPAINTDEVICE(&pixmap), this); TQFontMetrics fontMetrics = painter.fontMetrics(); int maxLineWidth; if(viewColorNames) { @@ -249,12 +249,12 @@ void PaletteViewScrolledArea::paintEvent(TQPaintEvent* /*event*/) { int lastRow = (posY + height() - 1 + rowHeight - 1)/rowHeight; if(viewColorNames) painter.fillRect(0, 0, rowWidth, height(), - TQBrush( TQFrame::palette().active().base() )); - TQBrush normalBackgroundBrush(TQFrame::palette().active().background()); - TQBrush selectedBackgroundBrush(TQFrame::palette().active().highlight()); + TQBrush( TQFrame::tqpalette().active().base() )); + TQBrush normalBackgroundBrush(TQFrame::tqpalette().active().background()); + TQBrush selectedBackgroundBrush(TQFrame::tqpalette().active().highlight()); TQBrush foregroundBrush; - TQBrush cursorBrush(TQFrame::palette().active().foreground()); - TQPen backgroundPen(TQFrame::palette().active().foreground()); + TQBrush cursorBrush(TQFrame::tqpalette().active().foreground()); + TQPen backgroundPen(TQFrame::tqpalette().active().foreground()); int min = selectionMin(); int max = selectionMax(); int fontAscent = fontMetrics.ascent(); diff --git a/kcoloredit/paletteviewscrolledarea.h b/kcoloredit/paletteviewscrolledarea.h index db39e454..8e69a354 100644 --- a/kcoloredit/paletteviewscrolledarea.h +++ b/kcoloredit/paletteviewscrolledarea.h @@ -33,15 +33,16 @@ class TQScrollBar; */ class PaletteViewScrolledArea : public TQFrame { Q_OBJECT + TQ_OBJECT public: /** Constructs the widget */ PaletteViewScrolledArea(const int defaultCellWidth, const int defaultCellHeight, const int cellSpacing, TQScrollBar* scrollBar, TQScrollBar* hScrollBar, KColorEditView* view, - TQWidget* parent = 0, const char* name = 0); + TQWidget* tqparent = 0, const char* name = 0); ~PaletteViewScrolledArea(); - /** Sets cells sizes and then calls repaintPalette() */ + /** Sets cells sizes and then calls tqrepaintPalette() */ void redraw(); public slots: @@ -105,8 +106,8 @@ protected: * visible area width */ void setCellsSizes(); - /** repaints the palette */ - void repaintPalette(); + /** tqrepaints the palette */ + void tqrepaintPalette(); /** @return A color index at a given position, -1 if none */ int colorIndex(const TQPoint& point) const; /** @return A color at a given position */ diff --git a/kcoloredit/texteditselection.cpp b/kcoloredit/texteditselection.cpp index 4b1d6a56..bf00ab3d 100644 --- a/kcoloredit/texteditselection.cpp +++ b/kcoloredit/texteditselection.cpp @@ -24,7 +24,7 @@ #include "main.h" #include "texteditselection.h" -TextEditSelection::TextEditSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) { +TextEditSelection::TextEditSelection(TQWidget *tqparent, const char *name ) : TQWidget(tqparent,name) { inChangingComponents = false; TQVBoxLayout* topLayout = new TQVBoxLayout(this, 4); TQGridLayout* componentsLayout = new TQGridLayout(3, 5, 2); @@ -59,14 +59,14 @@ TextEditSelection::~TextEditSelection(){ } void TextEditSelection::addComponent(const int index, TQLineEdit* lineEdit, const int maxValue, - const TQString& labelString, const int row, const int column, TQGridLayout* layout) { + const TQString& labelString, const int row, const int column, TQGridLayout* tqlayout) { TQLabel* label = new TQLabel(labelString, this); - lineEdit->setValidator(new TQIntValidator( 0, maxValue, lineEdit )); + lineEdit->setValidator(new TQIntValidator( 0, maxValue, TQT_TQOBJECT(lineEdit) )); lineEditTable[index] = lineEdit; lineEdit->setMinimumWidth(lineEdit->fontMetrics().width( TQString("8888") )); lineEdit->setMaximumWidth(lineEdit->fontMetrics().width( TQString("8888888") )); - layout->addWidget(label, row, column*3); - layout->addWidget(lineEdit, row, column*3 + 1); + tqlayout->addWidget(label, row, column*3); + tqlayout->addWidget(lineEdit, row, column*3 + 1); } void TextEditSelection::setRgbString(const int red, const int green, const int blue) { diff --git a/kcoloredit/texteditselection.h b/kcoloredit/texteditselection.h index e140a5dc..67a299a1 100644 --- a/kcoloredit/texteditselection.h +++ b/kcoloredit/texteditselection.h @@ -30,10 +30,11 @@ */ class TextEditSelection : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** Constructs the widget */ - TextEditSelection(TQWidget *parent=0, const char *name=0); + TextEditSelection(TQWidget *tqparent=0, const char *name=0); ~TextEditSelection(); signals: @@ -47,7 +48,7 @@ public slots: protected: /** Adds a component line edit */ void addComponent(const int index, TQLineEdit* lineEdit, const int maxValue, const TQString& labelString, - const int row, const int column, TQGridLayout* layout); + const int row, const int column, TQGridLayout* tqlayout); /** sets RGB string in rgbStringLineEdit */ void setRgbString(const int red, const int green, const int blue); diff --git a/kcoloredit/textselection.cpp b/kcoloredit/textselection.cpp index f916d48f..ae15650d 100644 --- a/kcoloredit/textselection.cpp +++ b/kcoloredit/textselection.cpp @@ -17,7 +17,7 @@ #include "textselection.h" -TextSelection::TextSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) { +TextSelection::TextSelection(TQWidget *tqparent, const char *name ) : TQWidget(tqparent,name) { } TextSelection::~TextSelection(){ |