From 11f31c37e5fa4889d9989f10272f44845449cb7b Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 6 Sep 2010 20:59:29 +0000 Subject: Initial TQt conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/gui/editors/guitar/Chord.cpp | 14 +-- src/gui/editors/guitar/Chord.h | 20 +-- src/gui/editors/guitar/ChordMap.cpp | 28 ++--- src/gui/editors/guitar/ChordMap.h | 10 +- src/gui/editors/guitar/ChordXmlHandler.cpp | 40 +++--- src/gui/editors/guitar/ChordXmlHandler.h | 30 ++--- src/gui/editors/guitar/Fingering.cpp | 14 +-- src/gui/editors/guitar/Fingering.h | 6 +- src/gui/editors/guitar/FingeringBox.cpp | 30 ++--- src/gui/editors/guitar/FingeringBox.h | 22 ++-- src/gui/editors/guitar/FingeringListBoxItem.cpp | 4 +- src/gui/editors/guitar/FingeringListBoxItem.h | 4 +- src/gui/editors/guitar/GuitarChordEditorDialog.cpp | 36 +++--- src/gui/editors/guitar/GuitarChordEditorDialog.h | 14 +-- .../editors/guitar/GuitarChordSelectorDialog.cpp | 134 ++++++++++----------- src/gui/editors/guitar/GuitarChordSelectorDialog.h | 40 +++--- src/gui/editors/guitar/NoteSymbols.cpp | 54 ++++----- src/gui/editors/guitar/NoteSymbols.h | 30 ++--- 18 files changed, 265 insertions(+), 265 deletions(-) (limited to 'src/gui/editors/guitar') diff --git a/src/gui/editors/guitar/Chord.cpp b/src/gui/editors/guitar/Chord.cpp index 23efe7d..c697e96 100644 --- a/src/gui/editors/guitar/Chord.cpp +++ b/src/gui/editors/guitar/Chord.cpp @@ -25,7 +25,7 @@ #include "Chord.h" #include "base/Event.h" -#include +#include namespace Rosegarden { @@ -44,13 +44,13 @@ Chord::Chord() { } -Chord::Chord(const QString& root, const QString& ext) +Chord::Chord(const TQString& root, const TQString& ext) : m_root(root), m_ext(ext), m_isUserChord(false) { if (m_ext.isEmpty()) - m_ext = QString::null; + m_ext = TQString::null; } Chord::Chord(const Event& e) @@ -66,15 +66,15 @@ Chord::Chord(const Event& e) ok = e.get(ExtPropertyName, f); if (ok) { if (f.length() == 0) - m_ext = QString::null; + m_ext = TQString::null; else m_ext = f; } ok = e.get(FingeringPropertyName, f); if (ok) { - QString qf(f); - QString errString; + TQString qf(f); + TQString errString; Fingering fingering = Fingering::parseFingering(qf, errString); setFingering(fingering); @@ -90,7 +90,7 @@ Event* Chord::getAsEvent(timeT absoluteTime) const return e; } -const QRegExp Chord::ALT_BASS_REGEXP("/[A-G]"); +const TQRegExp Chord::ALT_BASS_REGEXP("/[A-G]"); bool operator<(const Chord& a, const Chord& b) { diff --git a/src/gui/editors/guitar/Chord.h b/src/gui/editors/guitar/Chord.h index 9e84cc3..f519c9c 100644 --- a/src/gui/editors/guitar/Chord.h +++ b/src/gui/editors/guitar/Chord.h @@ -30,8 +30,8 @@ #include "misc/Debug.h" #include -#include -#include +#include +#include namespace Rosegarden { @@ -53,7 +53,7 @@ public: static const PropertyName FingeringPropertyName; Chord(); - Chord(const QString& root, const QString& ext = QString::null); + Chord(const TQString& root, const TQString& ext = TQString::null); Chord(const Event&); Event* getAsEvent(timeT absoluteTime) const; @@ -64,11 +64,11 @@ public: bool isUserChord() const { return m_isUserChord; } void setUserChord(bool c) { m_isUserChord = c; } - QString getRoot() const { return m_root; } - void setRoot(QString r) { m_root = r; } + TQString getRoot() const { return m_root; } + void setRoot(TQString r) { m_root = r; } - QString getExt() const { return m_ext; } - void setExt(QString r) { m_ext = r.isEmpty() ? QString::null : r; } + TQString getExt() const { return m_ext; } + void setExt(TQString r) { m_ext = r.isEmpty() ? TQString::null : r; } bool hasAltBass() const { return m_ext.contains(ALT_BASS_REGEXP); } @@ -87,10 +87,10 @@ public: protected: - static const QRegExp ALT_BASS_REGEXP; + static const TQRegExp ALT_BASS_REGEXP; - QString m_root; - QString m_ext; + TQString m_root; + TQString m_ext; Fingering m_fingering; diff --git a/src/gui/editors/guitar/ChordMap.cpp b/src/gui/editors/guitar/ChordMap.cpp index 06662d9..207a336 100644 --- a/src/gui/editors/guitar/ChordMap.cpp +++ b/src/gui/editors/guitar/ChordMap.cpp @@ -25,8 +25,8 @@ #include "misc/Debug.h" #include "ChordMap.h" -#include -#include +#include +#include namespace Rosegarden { @@ -47,7 +47,7 @@ void ChordMap::insert(const Chord& c) ChordMap::chordarray -ChordMap::getChords(const QString& root, const QString& ext) const +ChordMap::getChords(const TQString& root, const TQString& ext) const { chordarray res; @@ -74,15 +74,15 @@ ChordMap::getChords(const QString& root, const QString& ext) const QStringList ChordMap::getRootList() const { - static QStringList rootNotes; + static TQStringList rootNotes; if (rootNotes.count() == 0) { - rootNotes = QStringList::split(QString(","), "A,A#/Bb,B,C,C#/Db,D,D#/Eb,E,F,F#/Gb,G,G#/Ab"); + rootNotes = TQStringList::split(TQString(","), "A,A#/Bb,B,C,C#/Db,D,D#/Eb,E,F,F#/Gb,G,G#/Ab"); } // extract roots from map itself - not a very good idea // -// QString currentRoot; +// TQString currentRoot; // // for(chordset::const_iterator i = m_map.begin(); i != m_map.end(); ++i) { // const Chord& chord = *i; @@ -96,10 +96,10 @@ ChordMap::getRootList() const } QStringList -ChordMap::getExtList(const QString& root) const +ChordMap::getExtList(const TQString& root) const { - QStringList extList; - QString currentExt = "ZZ"; + TQStringList extList; + TQString currentExt = "ZZ"; Chord tmp(root); @@ -134,14 +134,14 @@ ChordMap::remove(const Chord& c) m_needSave = true; } -bool ChordMap::saveDocument(const QString& filename, bool userChordsOnly, QString& errMsg) +bool ChordMap::saveDocument(const TQString& filename, bool userChordsOnly, TQString& errMsg) { - QFile file(filename); + TQFile file(filename); file.open(IO_WriteOnly); - QTextStream outStream(&file); + TQTextStream outStream(&file); - outStream.setEncoding(QTextStream::UnicodeUTF8); + outStream.setEncoding(TQTextStream::UnicodeUTF8); outStream << "\n" << "\n" @@ -153,7 +153,7 @@ bool ChordMap::saveDocument(const QString& filename, bool userChordsOnly, QStrin outStream << "\n"; - QString currentExt, currentRoot; + TQString currentExt, currentRoot; for(iterator i = begin(); i != end(); ++i) { const Chord& chord = *i; diff --git a/src/gui/editors/guitar/ChordMap.h b/src/gui/editors/guitar/ChordMap.h index 5b7488d..7c7ba04 100644 --- a/src/gui/editors/guitar/ChordMap.h +++ b/src/gui/editors/guitar/ChordMap.h @@ -27,7 +27,7 @@ #include "Chord.h" -#include +#include #include namespace Rosegarden @@ -56,17 +56,17 @@ public: void substitute(const Chord& oldChord, const Chord& newChord); void remove(const Chord&); - chordarray getChords(const QString& root, const QString& ext) const; + chordarray getChords(const TQString& root, const TQString& ext) const; - QStringList getRootList() const; - QStringList getExtList(const QString& root) const; + TQStringList getRootList() const; + TQStringList getExtList(const TQString& root) const; void debugDump() const; bool needSave() const { return m_needSave; } void clearNeedSave() { m_needSave = false; } - bool saveDocument(const QString& filename, bool userChordsOnly, QString& errMsg); + bool saveDocument(const TQString& filename, bool userChordsOnly, TQString& errMsg); iterator begin() { return m_map.begin(); } iterator end() { return m_map.end(); } diff --git a/src/gui/editors/guitar/ChordXmlHandler.cpp b/src/gui/editors/guitar/ChordXmlHandler.cpp index 701c43c..6802485 100644 --- a/src/gui/editors/guitar/ChordXmlHandler.cpp +++ b/src/gui/editors/guitar/ChordXmlHandler.cpp @@ -41,12 +41,12 @@ bool ChordXmlHandler::startDocument() return true; } -bool ChordXmlHandler::startElement(const QString& namespaceURI, - const QString& localName, - const QString& qName, - const QXmlAttributes& atts) +bool ChordXmlHandler::startElement(const TQString& namespaceURI, + const TQString& localName, + const TQString& qName, + const TQXmlAttributes& atts) { - QString lcName = qName.lower(); + TQString lcName = qName.lower(); if (lcName == "chordset") { // start new chord set @@ -60,7 +60,7 @@ bool ChordXmlHandler::startElement(const QString& namespaceURI, m_currentChord.setExt(atts.value("ext").stripWhiteSpace()); if (atts.index("user") >= 0) { - QString userVal = atts.value("user").stripWhiteSpace().lower(); + TQString userVal = atts.value("user").stripWhiteSpace().lower(); bool res = (userVal == "yes" || userVal == "1" || userVal == "true"); m_currentChord.setUserChord(res); } else { @@ -74,11 +74,11 @@ bool ChordXmlHandler::startElement(const QString& namespaceURI, return true; } -bool ChordXmlHandler::endElement(const QString& namespaceURI, - const QString& localName, - const QString& qName) +bool ChordXmlHandler::endElement(const TQString& namespaceURI, + const TQString& localName, + const TQString& qName) { - QString lcName = qName.lower(); + TQString lcName = qName.lower(); if (lcName == "fingering") { @@ -97,9 +97,9 @@ bool ChordXmlHandler::endElement(const QString& namespaceURI, return true; } -bool ChordXmlHandler::characters(const QString& ch) +bool ChordXmlHandler::characters(const TQString& ch) { - QString ch2 = ch.simplifyWhiteSpace(); + TQString ch2 = ch.simplifyWhiteSpace(); if (!ch2.isEmpty() && m_inFingering) { if (!parseFingering(ch2)) @@ -114,9 +114,9 @@ bool ChordXmlHandler::endDocument() return true; } -bool ChordXmlHandler::parseFingering(const QString& ch) { +bool ChordXmlHandler::parseFingering(const TQString& ch) { - QString errString; + TQString errString; Guitar::Fingering fingering = Guitar::Fingering::parseFingering(ch, errString); @@ -131,23 +131,23 @@ bool ChordXmlHandler::parseFingering(const QString& ch) { } bool -ChordXmlHandler::error(const QXmlParseException& exception) +ChordXmlHandler::error(const TQXmlParseException& exception) { - m_errorString = QString("%1 at line %2, column %3") + m_errorString = TQString("%1 at line %2, column %3") .arg(exception.message()) .arg(exception.lineNumber()) .arg(exception.columnNumber()); - return QXmlDefaultHandler::error( exception ); + return TQXmlDefaultHandler::error( exception ); } bool -ChordXmlHandler::fatalError(const QXmlParseException& exception) +ChordXmlHandler::fatalError(const TQXmlParseException& exception) { - m_errorString = QString("%1 at line %2, column %3") + m_errorString = TQString("%1 at line %2, column %3") .arg(exception.message()) .arg(exception.lineNumber()) .arg(exception.columnNumber()); - return QXmlDefaultHandler::fatalError( exception ); + return TQXmlDefaultHandler::fatalError( exception ); } diff --git a/src/gui/editors/guitar/ChordXmlHandler.h b/src/gui/editors/guitar/ChordXmlHandler.h index ca25168..f9c2e8b 100644 --- a/src/gui/editors/guitar/ChordXmlHandler.h +++ b/src/gui/editors/guitar/ChordXmlHandler.h @@ -30,7 +30,7 @@ #include "Chord.h" #include "ChordMap.h" -#include +#include namespace Rosegarden @@ -44,31 +44,31 @@ public: /// overloaded handler functions virtual bool startDocument(); - virtual bool startElement(const QString& namespaceURI, - const QString& localName, - const QString& qName, - const QXmlAttributes& atts); + virtual bool startElement(const TQString& namespaceURI, + const TQString& localName, + const TQString& qName, + const TQXmlAttributes& atts); - virtual bool endElement(const QString& namespaceURI, - const QString& localName, - const QString& qName); + virtual bool endElement(const TQString& namespaceURI, + const TQString& localName, + const TQString& qName); - virtual bool characters(const QString& ch); + virtual bool characters(const TQString& ch); virtual bool endDocument (); /// Return the error string set during the parsing (if any) - QString errorString() { return m_errorString; } - bool error(const QXmlParseException& exception); - bool fatalError(const QXmlParseException& exception); + TQString errorString() { return m_errorString; } + bool error(const TQXmlParseException& exception); + bool fatalError(const TQXmlParseException& exception); protected: - bool parseFingering(const QString& ch); + bool parseFingering(const TQString& ch); Guitar::Chord m_currentChord; - QString m_currentRoot; - QString m_errorString; + TQString m_currentRoot; + TQString m_errorString; bool m_inFingering; Guitar::ChordMap& m_chordMap; }; diff --git a/src/gui/editors/guitar/Fingering.cpp b/src/gui/editors/guitar/Fingering.cpp index dd1edbd..59459e9 100644 --- a/src/gui/editors/guitar/Fingering.cpp +++ b/src/gui/editors/guitar/Fingering.cpp @@ -26,7 +26,7 @@ #include "misc/Debug.h" -#include +#include #include #include #include @@ -42,9 +42,9 @@ Fingering::Fingering(unsigned int nbStrings) : { } -Fingering::Fingering(QString s) +Fingering::Fingering(TQString s) { - QString errString; + TQString errString; Fingering t = parseFingering(s, errString); m_strings = t.m_strings; } @@ -97,15 +97,15 @@ Fingering::getBarre() const } Fingering -Fingering::parseFingering(const QString& ch, QString& errorString) +Fingering::parseFingering(const TQString& ch, TQString& errorString) { - QStringList tokens = QStringList::split(' ', ch); + TQStringList tokens = TQStringList::split(' ', ch); unsigned int idx = 0; Fingering fingering; - for(QStringList::iterator i = tokens.begin(); i != tokens.end() && idx < fingering.getNbStrings(); ++i, ++idx) { - QString t = *i; + for(TQStringList::iterator i = tokens.begin(); i != tokens.end() && idx < fingering.getNbStrings(); ++i, ++idx) { + TQString t = *i; bool b = false; unsigned int fn = t.toUInt(&b); if (b) { diff --git a/src/gui/editors/guitar/Fingering.h b/src/gui/editors/guitar/Fingering.h index 41d9799..32693dd 100644 --- a/src/gui/editors/guitar/Fingering.h +++ b/src/gui/editors/guitar/Fingering.h @@ -26,7 +26,7 @@ #define _RG_FINGERING_H_ #include -#include +#include #include "base/Event.h" namespace Rosegarden @@ -52,7 +52,7 @@ public: static const unsigned int DEFAULT_NB_STRINGS = 6; Fingering(unsigned int nbStrings = DEFAULT_NB_STRINGS); - Fingering(QString); + Fingering(TQString); enum { MUTED = -1, OPEN = 0 }; @@ -78,7 +78,7 @@ public: const_iterator begin() const { return m_strings.begin(); } const_iterator end() const { return m_strings.end(); } - static Fingering parseFingering(const QString&, QString& errorString); + static Fingering parseFingering(const TQString&, TQString& errorString); std::string toString() const; protected: diff --git a/src/gui/editors/guitar/FingeringBox.cpp b/src/gui/editors/guitar/FingeringBox.cpp index 885ba83..6695a66 100644 --- a/src/gui/editors/guitar/FingeringBox.cpp +++ b/src/gui/editors/guitar/FingeringBox.cpp @@ -31,8 +31,8 @@ namespace Rosegarden { -FingeringBox::FingeringBox(unsigned int nbFrets, unsigned int nbStrings, bool editable, QWidget *parent, const char* name) - : QFrame(parent, name), +FingeringBox::FingeringBox(unsigned int nbFrets, unsigned int nbStrings, bool editable, TQWidget *parent, const char* name) + : TQFrame(parent, name), m_nbFretsDisplayed(nbFrets), m_startFret(1), m_nbStrings(nbStrings), @@ -44,8 +44,8 @@ FingeringBox::FingeringBox(unsigned int nbFrets, unsigned int nbStrings, bool ed init(); } -FingeringBox::FingeringBox(bool editable, QWidget *parent, const char* name) - : QFrame(parent, name), +FingeringBox::FingeringBox(bool editable, TQWidget *parent, const char* name) + : TQFrame(parent, name), m_nbFretsDisplayed(DEFAULT_NB_DISPLAYED_FRETS), m_startFret(1), m_nbStrings(Guitar::Fingering::DEFAULT_NB_STRINGS), @@ -58,7 +58,7 @@ FingeringBox::FingeringBox(bool editable, QWidget *parent, const char* name) void FingeringBox::init() { - setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); + setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); setFixedSize(IMG_WIDTH, IMG_HEIGHT); setBackgroundMode(PaletteBase); if (m_editable) @@ -67,7 +67,7 @@ FingeringBox::init() } void -FingeringBox::drawContents(QPainter* p) +FingeringBox::drawContents(TQPainter* p) { // NOTATION_DEBUG << "FingeringBox::drawContents()" << endl; @@ -140,7 +140,7 @@ FingeringBox::setFingering(const Guitar::Fingering& f) { } unsigned int -FingeringBox::getStringNumber(const QPoint& pos) +FingeringBox::getStringNumber(const TQPoint& pos) { PositionPair result = m_noteSymbols.getStringNumber(maximumHeight(), pos.x(), @@ -156,7 +156,7 @@ FingeringBox::getStringNumber(const QPoint& pos) } unsigned int -FingeringBox::getFretNumber(const QPoint& pos) +FingeringBox::getFretNumber(const TQPoint& pos) { unsigned int fretNum = 0; @@ -178,7 +178,7 @@ FingeringBox::getFretNumber(const QPoint& pos) } void -FingeringBox::mousePressEvent(QMouseEvent *event) +FingeringBox::mousePressEvent(TQMouseEvent *event) { if (!m_editable) return; @@ -194,7 +194,7 @@ FingeringBox::mousePressEvent(QMouseEvent *event) } void -FingeringBox::mouseReleaseEvent(QMouseEvent *event) +FingeringBox::mouseReleaseEvent(TQMouseEvent *event) { if(!m_editable) return ; @@ -250,7 +250,7 @@ FingeringBox::processMouseRelease(unsigned int release_string_num, void -FingeringBox::mouseMoveEvent( QMouseEvent *event ) +FingeringBox::mouseMoveEvent( TQMouseEvent *event ) { if (!m_editable) return; @@ -261,12 +261,12 @@ FingeringBox::mouseMoveEvent( QMouseEvent *event ) if (transientStringNb != m_transientStringNb || transientFretNb != m_transientFretNb) { - QRect r1 = m_noteSymbols.getTransientNoteSymbolRect(size(), + TQRect r1 = m_noteSymbols.getTransientNoteSymbolRect(size(), m_transientStringNb, m_transientFretNb - (m_startFret - 1)); m_transientStringNb = transientStringNb; m_transientFretNb = transientFretNb; - QRect r2 = m_noteSymbols.getTransientNoteSymbolRect(size(), + TQRect r2 = m_noteSymbols.getTransientNoteSymbolRect(size(), m_transientStringNb, m_transientFretNb - (m_startFret - 1)); @@ -275,7 +275,7 @@ FingeringBox::mouseMoveEvent( QMouseEvent *event ) // RG_DEBUG << "Fingering::updateTransientPos r1 = " << r1 << " - r2 = " << r2 << endl; -// QRect updateRect = r1 | r2; +// TQRect updateRect = r1 | r2; // update(updateRect); update(); @@ -285,7 +285,7 @@ FingeringBox::mouseMoveEvent( QMouseEvent *event ) } void -FingeringBox::leaveEvent(QEvent*) +FingeringBox::leaveEvent(TQEvent*) { update(); } diff --git a/src/gui/editors/guitar/FingeringBox.h b/src/gui/editors/guitar/FingeringBox.h index b54c0a8..aa76e52 100644 --- a/src/gui/editors/guitar/FingeringBox.h +++ b/src/gui/editors/guitar/FingeringBox.h @@ -27,7 +27,7 @@ #ifndef _RG_FINGERINGBOX_H_ #define _RG_FINGERINGBOX_H_ -#include +#include #include "NoteSymbols.h" #include "Fingering.h" @@ -43,8 +43,8 @@ class FingeringBox : public QFrame static const unsigned int IMG_HEIGHT = 200; public: - FingeringBox(unsigned int nbFrets, unsigned int nbStrings, bool editable, QWidget *parent, const char* name = 0); - FingeringBox(bool editable, QWidget *parent, const char* name = 0); + FingeringBox(unsigned int nbFrets, unsigned int nbStrings, bool editable, TQWidget *parent, const char* name = 0); + FingeringBox(bool editable, TQWidget *parent, const char* name = 0); void setStartFret(unsigned int f) { m_startFret = f; update(); } unsigned int getStartFret() const { return m_startFret; } @@ -59,20 +59,20 @@ public: protected: void init(); - virtual void drawContents(QPainter*); + virtual void drawContents(TQPainter*); - virtual void mousePressEvent(QMouseEvent*); - virtual void mouseReleaseEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); - virtual void leaveEvent(QEvent*); + virtual void mousePressEvent(TQMouseEvent*); + virtual void mouseReleaseEvent(TQMouseEvent*); + virtual void mouseMoveEvent(TQMouseEvent*); + virtual void leaveEvent(TQEvent*); void processMouseRelease( unsigned int release_string_num, unsigned int release_fret_num); typedef std::pair PositionPair; - unsigned int getStringNumber(const QPoint&); + unsigned int getStringNumber(const TQPoint&); - unsigned int getFretNumber(const QPoint&); + unsigned int getFretNumber(const TQPoint&); //! Maximum number of frets displayed by FingeringBox unsigned int m_nbFretsDisplayed; @@ -98,7 +98,7 @@ protected: Guitar::NoteSymbols m_noteSymbols; - QRect m_r1, m_r2; + TQRect m_r1, m_r2; }; } diff --git a/src/gui/editors/guitar/FingeringListBoxItem.cpp b/src/gui/editors/guitar/FingeringListBoxItem.cpp index 31b92e9..aeb8fcd 100644 --- a/src/gui/editors/guitar/FingeringListBoxItem.cpp +++ b/src/gui/editors/guitar/FingeringListBoxItem.cpp @@ -27,8 +27,8 @@ namespace Rosegarden { -FingeringListBoxItem::FingeringListBoxItem(const Guitar::Chord& chord, QListBox* parent, QPixmap pixmap, QString fingeringString) - : QListBoxPixmap(parent, pixmap, fingeringString), +FingeringListBoxItem::FingeringListBoxItem(const Guitar::Chord& chord, TQListBox* parent, TQPixmap pixmap, TQString fingeringString) + : TQListBoxPixmap(parent, pixmap, fingeringString), m_chord(chord) { } diff --git a/src/gui/editors/guitar/FingeringListBoxItem.h b/src/gui/editors/guitar/FingeringListBoxItem.h index b7625e2..8b0a81a 100644 --- a/src/gui/editors/guitar/FingeringListBoxItem.h +++ b/src/gui/editors/guitar/FingeringListBoxItem.h @@ -26,7 +26,7 @@ #ifndef _RG_FINGERINGLISTBOXITEM_H_ #define _RG_FINGERINGLISTBOXITEM_H_ -#include +#include #include "Chord.h" namespace Rosegarden { @@ -34,7 +34,7 @@ namespace Rosegarden { class FingeringListBoxItem : public QListBoxPixmap { public: - FingeringListBoxItem(const Guitar::Chord& chord, QListBox* parent, QPixmap pixmap, QString fingeringString); + FingeringListBoxItem(const Guitar::Chord& chord, TQListBox* parent, TQPixmap pixmap, TQString fingeringString); const Guitar::Chord& getChord() { return m_chord; } protected: diff --git a/src/gui/editors/guitar/GuitarChordEditorDialog.cpp b/src/gui/editors/guitar/GuitarChordEditorDialog.cpp index 60da8b6..8a4fb3e 100644 --- a/src/gui/editors/guitar/GuitarChordEditorDialog.cpp +++ b/src/gui/editors/guitar/GuitarChordEditorDialog.cpp @@ -28,42 +28,42 @@ #include "ChordMap.h" #include -#include -#include +#include +#include #include #include #include -#include -#include +#include +#include namespace Rosegarden { -GuitarChordEditorDialog::GuitarChordEditorDialog(Guitar::Chord& chord, const Guitar::ChordMap& chordMap, QWidget *parent) +GuitarChordEditorDialog::GuitarChordEditorDialog(Guitar::Chord& chord, const Guitar::ChordMap& chordMap, TQWidget *parent) : KDialogBase(parent, "GuitarChordEditor", true, i18n("Guitar Chord Editor"), Ok|Cancel), m_chord(chord), m_chordMap(chordMap) { - QWidget *page = new QWidget(this); + TQWidget *page = new TQWidget(this); setMainWidget(page); - QGridLayout *topLayout = new QGridLayout(page, 7, 2, spacingHint()); + TQGridLayout *topLayout = new TQGridLayout(page, 7, 2, spacingHint()); - topLayout->addWidget(new QLabel(i18n("Start fret"), page), 0, 1); - m_startFret = new QSpinBox(1, 24, 1, page); + topLayout->addWidget(new TQLabel(i18n("Start fret"), page), 0, 1); + m_startFret = new TQSpinBox(1, 24, 1, page); topLayout->addWidget(m_startFret, 1, 1); - connect(m_startFret, SIGNAL(valueChanged(int)), - this, SLOT(slotStartFretChanged(int))); + connect(m_startFret, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotStartFretChanged(int))); - topLayout->addWidget(new QLabel(i18n("Root"), page), 2, 1); - m_rootNotesList = new QComboBox(page); + topLayout->addWidget(new TQLabel(i18n("Root"), page), 2, 1); + m_rootNotesList = new TQComboBox(page); topLayout->addWidget(m_rootNotesList, 3, 1); - topLayout->addWidget(new QLabel(i18n("Extension"), page), 4, 1); - m_ext = new QComboBox(true, page); + topLayout->addWidget(new TQLabel(i18n("Extension"), page), 4, 1); + m_ext = new TQComboBox(true, page); topLayout->addWidget(m_ext, 5, 1); - topLayout->addItem(new QSpacerItem(1, 1), 6, 1); + topLayout->addItem(new TQSpacerItem(1, 1), 6, 1); m_fingeringBox = new FingeringBox(true, page); m_fingeringBox->setFingering(m_chord.getFingering()); @@ -72,13 +72,13 @@ GuitarChordEditorDialog::GuitarChordEditorDialog(Guitar::Chord& chord, const Gui NOTATION_DEBUG << "GuitarChordEditorDialog : chord = " << m_chord << endl; - QStringList rootList = m_chordMap.getRootList(); + TQStringList rootList = m_chordMap.getRootList(); if (rootList.count() > 0) { m_rootNotesList->insertStringList(rootList); m_rootNotesList->setCurrentItem(rootList.findIndex(m_chord.getRoot())); } - QStringList extList = m_chordMap.getExtList(m_chord.getRoot()); + TQStringList extList = m_chordMap.getExtList(m_chord.getRoot()); if (extList.count() > 0) { m_ext->insertStringList(extList); m_ext->setCurrentItem(extList.findIndex(m_chord.getExt())); diff --git a/src/gui/editors/guitar/GuitarChordEditorDialog.h b/src/gui/editors/guitar/GuitarChordEditorDialog.h index fc01605..f26fcd3 100644 --- a/src/gui/editors/guitar/GuitarChordEditorDialog.h +++ b/src/gui/editors/guitar/GuitarChordEditorDialog.h @@ -30,8 +30,8 @@ #include "Chord.h" #include "ChordMap.h" -class QComboBox; -class QSpinBox; +class TQComboBox; +class TQSpinBox; namespace Rosegarden { @@ -44,7 +44,7 @@ class GuitarChordEditorDialog : public KDialogBase Q_OBJECT public: - GuitarChordEditorDialog(Guitar::Chord&, const Guitar::ChordMap& chordMap, QWidget *parent=0); + GuitarChordEditorDialog(Guitar::Chord&, const Guitar::ChordMap& chordMap, TQWidget *parent=0); protected slots: void slotStartFretChanged(int); @@ -52,12 +52,12 @@ protected slots: protected: - void populateExtensions(const QStringList&); + void populateExtensions(const TQStringList&); FingeringBox* m_fingeringBox; - QComboBox* m_rootNotesList; - QSpinBox* m_startFret; - QComboBox* m_ext; + TQComboBox* m_rootNotesList; + TQSpinBox* m_startFret; + TQComboBox* m_ext; Guitar::Chord& m_chord; const Guitar::ChordMap& m_chordMap; }; diff --git a/src/gui/editors/guitar/GuitarChordSelectorDialog.cpp b/src/gui/editors/guitar/GuitarChordSelectorDialog.cpp index bd62c1f..5430098 100644 --- a/src/gui/editors/guitar/GuitarChordSelectorDialog.cpp +++ b/src/gui/editors/guitar/GuitarChordSelectorDialog.cpp @@ -29,11 +29,11 @@ #include "FingeringListBoxItem.h" #include "misc/Debug.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -41,34 +41,34 @@ namespace Rosegarden { -GuitarChordSelectorDialog::GuitarChordSelectorDialog(QWidget *parent) +GuitarChordSelectorDialog::GuitarChordSelectorDialog(TQWidget *parent) : KDialogBase(parent, "GuitarChordSelector", true, i18n("Guitar Chord Selector"), Ok|Cancel) { - QWidget *page = new QWidget(this); + TQWidget *page = new TQWidget(this); setMainWidget(page); - QGridLayout *topLayout = new QGridLayout(page, 3, 4, spacingHint()); + TQGridLayout *topLayout = new TQGridLayout(page, 3, 4, spacingHint()); - topLayout->addWidget(new QLabel(i18n("Root"), page), 0, 0); - m_rootNotesList = new QListBox(page); + topLayout->addWidget(new TQLabel(i18n("Root"), page), 0, 0); + m_rootNotesList = new TQListBox(page); topLayout->addWidget(m_rootNotesList, 1, 0); - topLayout->addWidget(new QLabel(i18n("Extension"), page), 0, 1); - m_chordExtList = new QListBox(page); + topLayout->addWidget(new TQLabel(i18n("Extension"), page), 0, 1); + m_chordExtList = new TQListBox(page); topLayout->addWidget(m_chordExtList, 1, 1); - m_newFingeringButton = new QPushButton(i18n("New"), page); - m_deleteFingeringButton = new QPushButton(i18n("Delete"), page); - m_editFingeringButton = new QPushButton(i18n("Edit"), page); + m_newFingeringButton = new TQPushButton(i18n("New"), page); + m_deleteFingeringButton = new TQPushButton(i18n("Delete"), page); + m_editFingeringButton = new TQPushButton(i18n("Edit"), page); - m_chordComplexityCombo = new QComboBox(page); + m_chordComplexityCombo = new TQComboBox(page); m_chordComplexityCombo->insertItem(i18n("beginner")); m_chordComplexityCombo->insertItem(i18n("common")); m_chordComplexityCombo->insertItem(i18n("all")); - connect(m_chordComplexityCombo, SIGNAL(activated(int)), - this, SLOT(slotComplexityChanged(int))); + connect(m_chordComplexityCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotComplexityChanged(int))); - QVBoxLayout* vboxLayout = new QVBoxLayout(page, 5); + TQVBoxLayout* vboxLayout = new TQVBoxLayout(page, 5); topLayout->addMultiCellLayout(vboxLayout, 1, 3, 2, 2); vboxLayout->addWidget(m_chordComplexityCombo); vboxLayout->addStretch(10); @@ -76,26 +76,26 @@ GuitarChordSelectorDialog::GuitarChordSelectorDialog(QWidget *parent) vboxLayout->addWidget(m_deleteFingeringButton); vboxLayout->addWidget(m_editFingeringButton); - connect(m_newFingeringButton, SIGNAL(clicked()), - this, SLOT(slotNewFingering())); - connect(m_deleteFingeringButton, SIGNAL(clicked()), - this, SLOT(slotDeleteFingering())); - connect(m_editFingeringButton, SIGNAL(clicked()), - this, SLOT(slotEditFingering())); + connect(m_newFingeringButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotNewFingering())); + connect(m_deleteFingeringButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotDeleteFingering())); + connect(m_editFingeringButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotEditFingering())); - topLayout->addWidget(new QLabel(i18n("Fingerings"), page), 0, 3); - m_fingeringsList = new QListBox(page); + topLayout->addWidget(new TQLabel(i18n("Fingerings"), page), 0, 3); + m_fingeringsList = new TQListBox(page); topLayout->addMultiCellWidget(m_fingeringsList, 1, 2, 3, 3); m_fingeringBox = new FingeringBox(false, page); topLayout->addMultiCellWidget(m_fingeringBox, 2, 2, 0, 1); - connect(m_rootNotesList, SIGNAL(highlighted(int)), - this, SLOT(slotRootHighlighted(int))); - connect(m_chordExtList, SIGNAL(highlighted(int)), - this, SLOT(slotChordExtHighlighted(int))); - connect(m_fingeringsList, SIGNAL(highlighted(QListBoxItem*)), - this, SLOT(slotFingeringHighlighted(QListBoxItem*))); + connect(m_rootNotesList, TQT_SIGNAL(highlighted(int)), + this, TQT_SLOT(slotRootHighlighted(int))); + connect(m_chordExtList, TQT_SIGNAL(highlighted(int)), + this, TQT_SLOT(slotChordExtHighlighted(int))); + connect(m_fingeringsList, TQT_SIGNAL(highlighted(TQListBoxItem*)), + this, TQT_SLOT(slotFingeringHighlighted(TQListBoxItem*))); } void @@ -103,7 +103,7 @@ GuitarChordSelectorDialog::init() { // populate the listboxes // - std::vector chordFiles = getAvailableChordFiles(); + std::vector chordFiles = getAvailableChordFiles(); parseChordFiles(chordFiles); @@ -115,11 +115,11 @@ GuitarChordSelectorDialog::init() void GuitarChordSelectorDialog::populate() { - QStringList rootList = m_chordMap.getRootList(); + TQStringList rootList = m_chordMap.getRootList(); if (rootList.count() > 0) { m_rootNotesList->insertStringList(rootList); - QStringList extList = m_chordMap.getExtList(rootList.first()); + TQStringList extList = m_chordMap.getExtList(rootList.first()); populateExtensions(extList); Guitar::ChordMap::chordarray chords = m_chordMap.getChords(rootList.first(), extList.first()); @@ -156,7 +156,7 @@ GuitarChordSelectorDialog::slotRootHighlighted(int i) m_chord.setRoot(m_rootNotesList->text(i)); - QStringList extList = m_chordMap.getExtList(m_chord.getRoot()); + TQStringList extList = m_chordMap.getExtList(m_chord.getRoot()); populateExtensions(extList); if (m_chordExtList->count() > 0) m_chordExtList->setCurrentItem(0); @@ -176,7 +176,7 @@ GuitarChordSelectorDialog::slotChordExtHighlighted(int i) } void -GuitarChordSelectorDialog::slotFingeringHighlighted(QListBoxItem* listBoxItem) +GuitarChordSelectorDialog::slotFingeringHighlighted(TQListBoxItem* listBoxItem) { NOTATION_DEBUG << "GuitarChordSelectorDialog::slotFingeringHighlighted\n"; @@ -193,7 +193,7 @@ GuitarChordSelectorDialog::slotComplexityChanged(int) { // simply repopulate the extension list box // - QStringList extList = m_chordMap.getExtList(m_chord.getRoot()); + TQStringList extList = m_chordMap.getExtList(m_chord.getRoot()); populateExtensions(extList); if (m_chordExtList->count() > 0) m_chordExtList->setCurrentItem(0); @@ -210,7 +210,7 @@ GuitarChordSelectorDialog::slotNewFingering() GuitarChordEditorDialog* chordEditorDialog = new GuitarChordEditorDialog(newChord, m_chordMap, this); - if (chordEditorDialog->exec() == QDialog::Accepted) { + if (chordEditorDialog->exec() == TQDialog::Accepted) { m_chordMap.insert(newChord); // populate lists // @@ -245,7 +245,7 @@ GuitarChordSelectorDialog::slotEditFingering() Guitar::Chord newChord = m_chord; GuitarChordEditorDialog* chordEditorDialog = new GuitarChordEditorDialog(newChord, m_chordMap, this); - if (chordEditorDialog->exec() == QDialog::Accepted) { + if (chordEditorDialog->exec() == TQDialog::Accepted) { NOTATION_DEBUG << "GuitarChordSelectorDialog::slotEditFingering() - current map state :\n"; m_chordMap.debugDump(); m_chordMap.substitute(m_chord, newChord); @@ -280,13 +280,13 @@ GuitarChordSelectorDialog::setChord(const Guitar::Chord& chord) // select the chord's root // m_rootNotesList->setCurrentItem(0); - QListBoxItem* correspondingRoot = m_rootNotesList->findItem(chord.getRoot(), Qt::ExactMatch); + TQListBoxItem* correspondingRoot = m_rootNotesList->findItem(chord.getRoot(), Qt::ExactMatch); if (correspondingRoot) m_rootNotesList->setSelected(correspondingRoot, true); // update the dialog's complexity setting if needed, then populate the extension list // - QString chordExt = chord.getExt(); + TQString chordExt = chord.getExt(); int complexityLevel = m_chordComplexityCombo->currentItem(); int chordComplexity = evaluateChordComplexity(chordExt); @@ -294,7 +294,7 @@ GuitarChordSelectorDialog::setChord(const Guitar::Chord& chord) m_chordComplexityCombo->setCurrentItem(chordComplexity); } - QStringList extList = m_chordMap.getExtList(chord.getRoot()); + TQStringList extList = m_chordMap.getExtList(chord.getRoot()); populateExtensions(extList); // select the chord's extension @@ -303,7 +303,7 @@ GuitarChordSelectorDialog::setChord(const Guitar::Chord& chord) chordExt = ""; m_chordExtList->setSelected(0, true); } else { - QListBoxItem* correspondingExt = m_chordExtList->findItem(chordExt, Qt::ExactMatch); + TQListBoxItem* correspondingExt = m_chordExtList->findItem(chordExt, Qt::ExactMatch); if (correspondingExt) m_chordExtList->setSelected(correspondingExt, true); } @@ -321,9 +321,9 @@ GuitarChordSelectorDialog::populateFingerings(const Guitar::ChordMap::chordarray for(Guitar::ChordMap::chordarray::const_iterator i = chords.begin(); i != chords.end(); ++i) { const Guitar::Chord& chord = *i; - QString fingeringString = chord.getFingering().toString(); + TQString fingeringString = chord.getFingering().toString(); NOTATION_DEBUG << "GuitarChordSelectorDialog::populateFingerings " << chord << endl; - QPixmap fingeringPixmap = getFingeringPixmap(chord.getFingering()); + TQPixmap fingeringPixmap = getFingeringPixmap(chord.getFingering()); FingeringListBoxItem *item = new FingeringListBoxItem(chord, m_fingeringsList, fingeringPixmap, fingeringString); if (refFingering == chord.getFingering()) { NOTATION_DEBUG << "GuitarChordSelectorDialog::populateFingerings - fingering found " << fingeringString << endl; @@ -337,11 +337,11 @@ GuitarChordSelectorDialog::populateFingerings(const Guitar::ChordMap::chordarray QPixmap GuitarChordSelectorDialog::getFingeringPixmap(const Guitar::Fingering& fingering) const { - QPixmap pixmap(FINGERING_PIXMAP_WIDTH, FINGERING_PIXMAP_HEIGHT); + TQPixmap pixmap(FINGERING_PIXMAP_WIDTH, FINGERING_PIXMAP_HEIGHT); pixmap.fill(); - QPainter pp(&pixmap); - QPainter *p = &pp; + TQPainter pp(&pixmap); + TQPainter *p = &pp; p->setViewport(FINGERING_PIXMAP_H_MARGIN, FINGERING_PIXMAP_W_MARGIN, FINGERING_PIXMAP_WIDTH - FINGERING_PIXMAP_W_MARGIN, @@ -353,7 +353,7 @@ GuitarChordSelectorDialog::getFingeringPixmap(const Guitar::Fingering& fingering } void -GuitarChordSelectorDialog::populateExtensions(const QStringList& extList) +GuitarChordSelectorDialog::populateExtensions(const TQStringList& extList) { m_chordExtList->clear(); @@ -361,8 +361,8 @@ GuitarChordSelectorDialog::populateExtensions(const QStringList& extList) // some filtering needs to be done int complexityLevel = m_chordComplexityCombo->currentItem(); - QStringList filteredList; - for(QStringList::const_iterator i = extList.constBegin(); i != extList.constEnd(); ++i) { + TQStringList filteredList; + for(TQStringList::const_iterator i = extList.constBegin(); i != extList.constEnd(); ++i) { if (evaluateChordComplexity((*i).lower().stripWhiteSpace()) <= complexityLevel) { NOTATION_DEBUG << "GuitarChordSelectorDialog::populateExtensions - adding '" << *i << "'\n"; filteredList.append(*i); @@ -377,7 +377,7 @@ GuitarChordSelectorDialog::populateExtensions(const QStringList& extList) } int -GuitarChordSelectorDialog::evaluateChordComplexity(const QString& ext) +GuitarChordSelectorDialog::evaluateChordComplexity(const TQString& ext) { if (ext.isEmpty() || ext == "7" || @@ -402,24 +402,24 @@ GuitarChordSelectorDialog::evaluateChordComplexity(const QString& ext) } void -GuitarChordSelectorDialog::parseChordFiles(const std::vector& chordFiles) +GuitarChordSelectorDialog::parseChordFiles(const std::vector& chordFiles) { - for(std::vector::const_iterator i = chordFiles.begin(); i != chordFiles.end(); ++i) { + for(std::vector::const_iterator i = chordFiles.begin(); i != chordFiles.end(); ++i) { parseChordFile(*i); } } void -GuitarChordSelectorDialog::parseChordFile(const QString& chordFileName) +GuitarChordSelectorDialog::parseChordFile(const TQString& chordFileName) { ChordXmlHandler handler(m_chordMap); - QFile chordFile(chordFileName); + TQFile chordFile(chordFileName); bool ok = chordFile.open(IO_ReadOnly); if (!ok) KMessageBox::error(0, i18n("couldn't open file '%1'").arg(handler.errorString())); - QXmlInputSource source(chordFile); - QXmlSimpleReader reader; + TQXmlInputSource source(chordFile); + TQXmlSimpleReader reader; reader.setContentHandler(&handler); reader.setErrorHandler(&handler); NOTATION_DEBUG << "GuitarChordSelectorDialog::parseChordFile() parsing " << chordFileName << endl; @@ -436,15 +436,15 @@ GuitarChordSelectorDialog::setEditionEnabled(bool enabled) m_editFingeringButton->setEnabled(enabled); } -std::vector +std::vector GuitarChordSelectorDialog::getAvailableChordFiles() { - std::vector names; + std::vector names; // Read config for default directory - QStringList chordDictFiles = KGlobal::dirs()->findAllResources("appdata", "chords/*.xml"); + TQStringList chordDictFiles = KGlobal::dirs()->findAllResources("appdata", "chords/*.xml"); - for(QStringList::iterator i = chordDictFiles.begin(); i != chordDictFiles.end(); ++i) { + for(TQStringList::iterator i = chordDictFiles.begin(); i != chordDictFiles.end(); ++i) { NOTATION_DEBUG << "GuitarChordSelectorDialog::getAvailableChordFiles : adding file " << *i << endl; names.push_back(*i); } @@ -456,12 +456,12 @@ bool GuitarChordSelectorDialog::saveUserChordMap() { // Read config for user directory - QString userDir = KGlobal::dirs()->saveLocation("appdata", "chords/"); + TQString userDir = KGlobal::dirs()->saveLocation("appdata", "chords/"); - QString userChordDictPath = userDir + "/user_chords.xml"; + TQString userChordDictPath = userDir + "/user_chords.xml"; NOTATION_DEBUG << "GuitarChordSelectorDialog::saveUserChordMap() : saving user chord map to " << userChordDictPath << endl; - QString errMsg; + TQString errMsg; m_chordMap.saveDocument(userChordDictPath, true, errMsg); diff --git a/src/gui/editors/guitar/GuitarChordSelectorDialog.h b/src/gui/editors/guitar/GuitarChordSelectorDialog.h index 6c8f1ad..17b1eff 100644 --- a/src/gui/editors/guitar/GuitarChordSelectorDialog.h +++ b/src/gui/editors/guitar/GuitarChordSelectorDialog.h @@ -30,13 +30,13 @@ #include "ChordMap.h" #include -#include +#include #include -class QListBox; -class QListBoxItem; -class QComboBox; -class QPushButton; +class TQListBox; +class TQListBoxItem; +class TQComboBox; +class TQPushButton; namespace Rosegarden { @@ -50,7 +50,7 @@ class GuitarChordSelectorDialog : public KDialogBase enum { COMPLEXITY_BEGINNER, COMPLEXITY_COMMON, COMPLEXITY_ALL }; public: - GuitarChordSelectorDialog(QWidget *parent=0); + GuitarChordSelectorDialog(TQWidget *parent=0); void init(); @@ -61,7 +61,7 @@ public: protected slots: void slotRootHighlighted(int); void slotChordExtHighlighted(int); - void slotFingeringHighlighted(QListBoxItem*); + void slotFingeringHighlighted(TQListBoxItem*); void slotComplexityChanged(int); void slotNewFingering(); @@ -72,10 +72,10 @@ protected slots: protected: - void parseChordFiles(const std::vector& chordFiles); - void parseChordFile(const QString& chordFileName); + void parseChordFiles(const std::vector& chordFiles); + void parseChordFile(const TQString& chordFileName); void populateFingerings(const Guitar::ChordMap::chordarray&, const Guitar::Fingering& refFingering=Guitar::Fingering(0)); - void populateExtensions(const QStringList& extList); + void populateExtensions(const TQStringList& extList); /// set enabled state of edit/delete buttons void setEditionEnabled(bool); @@ -85,12 +85,12 @@ protected: void refresh(); bool saveUserChordMap(); - int evaluateChordComplexity(const QString& ext); + int evaluateChordComplexity(const TQString& ext); - QPixmap getFingeringPixmap(const Guitar::Fingering& fingering) const; + TQPixmap getFingeringPixmap(const Guitar::Fingering& fingering) const; /// Find all chord list files on the system - std::vector getAvailableChordFiles(); + std::vector getAvailableChordFiles(); Guitar::ChordMap m_chordMap; @@ -98,15 +98,15 @@ protected: Guitar::Chord m_chord; // Chord data - QListBox* m_rootNotesList; - QListBox* m_chordExtList; - QListBox* m_fingeringsList; + TQListBox* m_rootNotesList; + TQListBox* m_chordExtList; + TQListBox* m_fingeringsList; FingeringBox* m_fingeringBox; - QComboBox* m_chordComplexityCombo; - QPushButton* m_newFingeringButton; - QPushButton* m_deleteFingeringButton; - QPushButton* m_editFingeringButton; + TQComboBox* m_chordComplexityCombo; + TQPushButton* m_newFingeringButton; + TQPushButton* m_deleteFingeringButton; + TQPushButton* m_editFingeringButton; static const unsigned int FINGERING_PIXMAP_HEIGHT = 75; static const unsigned int FINGERING_PIXMAP_WIDTH = 75; diff --git a/src/gui/editors/guitar/NoteSymbols.cpp b/src/gui/editors/guitar/NoteSymbols.cpp index 14379de..b7ed8f4 100644 --- a/src/gui/editors/guitar/NoteSymbols.cpp +++ b/src/gui/editors/guitar/NoteSymbols.cpp @@ -63,10 +63,10 @@ NoteSymbols::getY ( int imgHeight, unsigned int fretNb, unsigned int nbOfFrets ) } void -NoteSymbols::drawMuteSymbol ( QPainter* p, +NoteSymbols::drawMuteSymbol ( TQPainter* p, unsigned int position ) const { - QRect v = p->viewport(); + TQRect v = p->viewport(); posPair x_pos = getX ( v.width(), position, m_nbOfStrings ); unsigned int y_pos = getTopBorder( v.height() ) / 2; @@ -89,10 +89,10 @@ NoteSymbols::drawMuteSymbol ( QPainter* p, } void -NoteSymbols::drawOpenSymbol ( QPainter* p, +NoteSymbols::drawOpenSymbol ( TQPainter* p, unsigned int position ) const { - QRect v = p->viewport(); + TQRect v = p->viewport(); posPair x_pos = getX ( v.width(), position, m_nbOfStrings ); unsigned int y_pos = getTopBorder( v.height() ) / 2; double columnWidth = x_pos.second; @@ -101,7 +101,7 @@ NoteSymbols::drawOpenSymbol ( QPainter* p, //std::cout << "NoteSymbols::drawOpenSymbol - drawing Open symbol at string #" << position //<< std::endl; - p->setBrush( QBrush(p->brush().color(), Qt::NoBrush) ); + p->setBrush( TQBrush(p->brush().color(), Qt::NoBrush) ); p->drawEllipse( x_pos.first - ( radius / 2 ), y_pos - ( radius / 2 ), radius, @@ -109,14 +109,14 @@ NoteSymbols::drawOpenSymbol ( QPainter* p, } void -NoteSymbols::drawNoteSymbol ( QPainter* p, +NoteSymbols::drawNoteSymbol ( TQPainter* p, unsigned int stringNb, int fretNb, bool transient ) const { // NOTATION_DEBUG << "NoteSymbols::drawNoteSymbol - string: " << stringNb << ", fret:" << fretNb << endl; - QRect v = p->viewport(); + TQRect v = p->viewport(); posPair x_pos = getX ( v.width(), stringNb, m_nbOfStrings ); posPair y_pos = getY ( v.height(), fretNb, m_nbOfFrets ); double columnWidth = x_pos.second; @@ -124,10 +124,10 @@ NoteSymbols::drawNoteSymbol ( QPainter* p, if (transient) { radius = static_cast( columnWidth /* * 0.9 */ ); - p->setBrush( QBrush(p->brush().color(), Qt::NoBrush) ); + p->setBrush( TQBrush(p->brush().color(), Qt::NoBrush) ); } else { radius = static_cast( columnWidth * 0.7 ); - p->setBrush( QBrush(p->brush().color(), Qt::SolidPattern) ); + p->setBrush( TQBrush(p->brush().color(), Qt::SolidPattern) ); } int x = x_pos.first - ( radius / 2 ), @@ -135,7 +135,7 @@ NoteSymbols::drawNoteSymbol ( QPainter* p, // y = y_pos.first - (radius / 2) - y_pos.second + TOP_GUITAR_CHORD_MARGIN; -// RG_DEBUG << "NoteSymbols::drawNoteSymbol : rect = " << QRect(x,y, radius, radius) << endl; +// RG_DEBUG << "NoteSymbols::drawNoteSymbol : rect = " << TQRect(x,y, radius, radius) << endl; p->drawEllipse( x, y, @@ -149,7 +149,7 @@ NoteSymbols::drawNoteSymbol ( QPainter* p, } void -NoteSymbols::drawBarreSymbol ( QPainter* p, +NoteSymbols::drawBarreSymbol ( TQPainter* p, int fretNb, unsigned int start, unsigned int end ) const @@ -160,7 +160,7 @@ NoteSymbols::drawBarreSymbol ( QPainter* p, drawNoteSymbol ( p, start, fretNb ); if ( ( end - start ) >= 1 ) { - QRect v = p->viewport(); + TQRect v = p->viewport(); posPair startXPos = getX ( v.width(), start, m_nbOfStrings ); posPair endXPos = getX ( v.width(), end, m_nbOfStrings ); posPair y_pos = getY ( v.height(), fretNb, m_nbOfFrets ); @@ -177,20 +177,20 @@ NoteSymbols::drawBarreSymbol ( QPainter* p, } void -NoteSymbols::drawFretNumber ( QPainter* p, +NoteSymbols::drawFretNumber ( TQPainter* p, unsigned int fret_num ) const { if ( fret_num > 1 ) { - QRect v = p->viewport(); + TQRect v = p->viewport(); unsigned int imgWidth = v.width(); unsigned int imgHeight = v.height(); p->save(); - QFont font; + TQFont font; font.setPixelSize(getFontPixelSize(v.width(), v.height())); p->setFont(font); - QString tmp; + TQString tmp; tmp.setNum( fret_num ); // Use NoteSymbols to grab X and Y for first fret @@ -205,7 +205,7 @@ NoteSymbols::drawFretNumber ( QPainter* p, } void -NoteSymbols::drawFrets ( QPainter* p ) const +NoteSymbols::drawFrets ( TQPainter* p ) const { /* std::cout << "NoteSymbols::drawFretHorizontalLines" << std::endl @@ -214,7 +214,7 @@ NoteSymbols::drawFrets ( QPainter* p ) const << " max string: " << maxStringNum << std::endl; */ - QRect v = p->viewport(); + TQRect v = p->viewport(); unsigned int imgWidth = v.width(); unsigned int imgHeight = v.height(); //unsigned int endXPos = getGuitarChordWidth(imgWidth) + getLeftBorder(imgWidth); @@ -223,7 +223,7 @@ NoteSymbols::drawFrets ( QPainter* p ) const unsigned int yGuitarChord = getGuitarChordHeight( imgHeight ); unsigned int rowHeight = yGuitarChord / m_nbOfFrets; - QPen pen(p->pen()); + TQPen pen(p->pen()); pen.setWidth(imgHeight >= 100 ? FRET_PEN_WIDTH : FRET_PEN_WIDTH / 2); p->save(); p->setPen(pen); @@ -239,8 +239,8 @@ NoteSymbols::drawFrets ( QPainter* p ) const y_pos, endXPos.first, y_pos); -// NOTATION_DEBUG << "NoteSymbols::drawFrets : " << QPoint(getLeftBorder(imgWidth), y_pos) -// << " to " << QPoint(endXPos.first, y_pos) << endl; +// NOTATION_DEBUG << "NoteSymbols::drawFrets : " << TQPoint(getLeftBorder(imgWidth), y_pos) +// << " to " << TQPoint(endXPos.first, y_pos) << endl; y_pos += rowHeight; @@ -251,10 +251,10 @@ NoteSymbols::drawFrets ( QPainter* p ) const } void -NoteSymbols::drawStrings ( QPainter* p ) const +NoteSymbols::drawStrings ( TQPainter* p ) const { // Vertical lines - QRect v = p->viewport(); + TQRect v = p->viewport(); int imgHeight = v.height(); int imgWidth = v.width(); @@ -266,7 +266,7 @@ NoteSymbols::drawStrings ( QPainter* p ) const unsigned int x_pos = (getX ( imgWidth, 0, m_nbOfStrings )).first; - QPen pen(p->pen()); + TQPen pen(p->pen()); pen.setWidth(imgWidth >= 100 ? STRING_PEN_WIDTH : STRING_PEN_WIDTH / 2); p->save(); p->setPen(pen); @@ -286,7 +286,7 @@ NoteSymbols::drawStrings ( QPainter* p ) const } -QRect NoteSymbols::getTransientNoteSymbolRect(QSize guitarChordSize, +TQRect NoteSymbols::getTransientNoteSymbolRect(TQSize guitarChordSize, unsigned int stringNb, int fretNb) const { @@ -298,7 +298,7 @@ QRect NoteSymbols::getTransientNoteSymbolRect(QSize guitarChordSize, int x = x_pos.first - ( radius / 2 ), y = y_pos.first + ( (y_pos.second - radius) / 2) - y_pos.second + TOP_GUITAR_CHORD_MARGIN; - return QRect(x, y, radius, radius); + return TQRect(x, y, radius, radius); } unsigned int @@ -438,7 +438,7 @@ NoteSymbols::getFretNumber ( int imgHeight, } void -NoteSymbols::drawFingeringPixmap(const Guitar::Fingering& fingering, const Guitar::NoteSymbols& noteSymbols, QPainter *p) +NoteSymbols::drawFingeringPixmap(const Guitar::Fingering& fingering, const Guitar::NoteSymbols& noteSymbols, TQPainter *p) { unsigned int startFret = fingering.getStartFret(); diff --git a/src/gui/editors/guitar/NoteSymbols.h b/src/gui/editors/guitar/NoteSymbols.h index f90fefb..9222a9a 100644 --- a/src/gui/editors/guitar/NoteSymbols.h +++ b/src/gui/editors/guitar/NoteSymbols.h @@ -27,8 +27,8 @@ #ifndef _RG_SYMBOLS_H_ #define _RG_SYMBOLS_H_ -#include -#include +#include +#include namespace Rosegarden { @@ -105,40 +105,40 @@ public: m_nbOfStrings(nbOfStrings), m_nbOfFrets(nbOfFrets) {}; - //! Display a mute symbol in the QPainter object + //! Display a mute symbol in the TQPainter object void - drawMuteSymbol ( QPainter* p, + drawMuteSymbol ( TQPainter* p, unsigned int position ) const; /* This code borrowed from KGuitar 0.5 */ - //! Display a open symbol in the QPainter object (KGuitar) - void drawOpenSymbol ( QPainter* p, + //! Display a open symbol in the TQPainter object (KGuitar) + void drawOpenSymbol ( TQPainter* p, unsigned int position ) const; /* This code borrowed from KGuitar 0.5 */ - //! Display a note symbol in the QPainter object (KGuitar) - void drawNoteSymbol ( QPainter* p, + //! Display a note symbol in the TQPainter object (KGuitar) + void drawNoteSymbol ( TQPainter* p, unsigned int stringNb, int fretNb, bool transient = false ) const; /* This code borrowed from KGuitar 0.5 */ /** - * Display a bar symbol in the QPainter object (KGuitar) + * Display a bar symbol in the TQPainter object (KGuitar) * The code from the KGuitar project was modified to display a bar. This feature was not * available in that project */ - void drawBarreSymbol ( QPainter* p, + void drawBarreSymbol ( TQPainter* p, int fretNb, unsigned int start, unsigned int end ) const; - void drawFretNumber ( QPainter* p, + void drawFretNumber ( TQPainter* p, unsigned int fret_num ) const; - void drawFrets ( QPainter* p ) const; + void drawFrets ( TQPainter* p ) const; - void drawStrings ( QPainter* p ) const; + void drawStrings ( TQPainter* p ) const; unsigned int getTopBorder ( unsigned int imgHeight ) const; @@ -164,11 +164,11 @@ public: unsigned int y_pos, unsigned int maxFretNum ) const; - QRect getTransientNoteSymbolRect(QSize guitarChordSize, + TQRect getTransientNoteSymbolRect(TQSize guitarChordSize, unsigned int stringNb, int fretNb) const; - static void drawFingeringPixmap(const Fingering& fingering, const NoteSymbols& noteSymbols, QPainter *p); + static void drawFingeringPixmap(const Fingering& fingering, const NoteSymbols& noteSymbols, TQPainter *p); private: -- cgit v1.2.1