diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /scheck/scheck.cpp | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'scheck/scheck.cpp')
-rw-r--r-- | scheck/scheck.cpp | 588 |
1 files changed, 294 insertions, 294 deletions
diff --git a/scheck/scheck.cpp b/scheck/scheck.cpp index d0d50422..bf00d699 100644 --- a/scheck/scheck.cpp +++ b/scheck/scheck.cpp @@ -37,31 +37,31 @@ #include <stdlib.h> -#include <qdict.h> -#include <qdrawutil.h> -#include <qpainter.h> -#include <qpointarray.h> -#include <qstyleplugin.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qfontmetrics.h> -#include <qgroupbox.h> -#include <qheader.h> -#include <qlabel.h> -#include <qmenubar.h> -#include <qobjectlist.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qregexp.h> -#include <qscrollbar.h> -#include <qslider.h> -#include <qstylesheet.h> -#include <qtabbar.h> -#include <qtimer.h> -#include <qtoolbutton.h> -#include <qtoolbar.h> -#include <qpopupmenu.h> -#include <qwidgetlist.h> +#include <tqdict.h> +#include <tqdrawutil.h> +#include <tqpainter.h> +#include <tqpointarray.h> +#include <tqstyleplugin.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqfontmetrics.h> +#include <tqgroupbox.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqmenubar.h> +#include <tqobjectlist.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqregexp.h> +#include <tqscrollbar.h> +#include <tqslider.h> +#include <tqstylesheet.h> +#include <tqtabbar.h> +#include <tqtimer.h> +#include <tqtoolbutton.h> +#include <tqtoolbar.h> +#include <tqpopupmenu.h> +#include <tqwidgetlist.h> #include <kdrawutil.h> #include <kaccelmanager.h> @@ -80,12 +80,12 @@ class StyleCheckStylePlugin : public QStylePlugin StyleCheckStylePlugin() {} ~StyleCheckStylePlugin() {} - QStringList keys() const + TQStringList keys() const { - return QStringList() << "Check"; + return TQStringList() << "Check"; } - QStyle* create( const QString& key ) + TQStyle* create( const TQString& key ) { if ( key == "check" ) return new StyleCheckStyle( ); @@ -100,12 +100,12 @@ KDE_Q_EXPORT_PLUGIN( StyleCheckStylePlugin ) // ### Remove globals -static QBitmap lightBmp; -static QBitmap grayBmp; -static QBitmap dgrayBmp; -static QBitmap centerBmp; -static QBitmap maskBmp; -static QBitmap xBmp; +static TQBitmap lightBmp; +static TQBitmap grayBmp; +static TQBitmap dgrayBmp; +static TQBitmap centerBmp; +static TQBitmap maskBmp; +static TQBitmap xBmp; static const int itemFrame = 1; static const int itemHMargin = 3; @@ -115,7 +115,7 @@ static const int rightBorder = 12; // --------------------------------------------------------------------------- -#include <qvaluevector.h> +#include <tqvaluevector.h> enum ColonMode { @@ -177,13 +177,13 @@ namespace class LowerCaseWords { private: - static QDict<bool>* m_words; + static TQDict<bool>* m_words; public: - static QDict<bool>* words() + static TQDict<bool>* words() { if (!m_words) { - m_words = new QDict<bool>; + m_words = new TQDict<bool>; // Prepositions under five letters, except from & under m_words->insert( "for", (bool*)1); m_words->insert( "in", (bool*)1); @@ -217,20 +217,20 @@ namespace } }; - QDict<bool>* LowerCaseWords::m_words = 0; + TQDict<bool>* LowerCaseWords::m_words = 0; class ExplicitCaseWords { private: - static QDict<const char>* m_words; + static TQDict<const char>* m_words; public: - static QDict<const char>* words() + static TQDict<const char>* words() { if (!m_words) { // Store the words like this: // "lowercase", "CorrectCase" - m_words = new QDict<const char>(61); + m_words = new TQDict<const char>(61); // week day names m_words->insert( "monday", "Monday"); m_words->insert( "tuesday", "Tuesday"); @@ -297,12 +297,12 @@ namespace } }; - QDict<const char>* ExplicitCaseWords::m_words = 0; + TQDict<const char>* ExplicitCaseWords::m_words = 0; } static bool xxMode; -static QColor severityColor(int severity) +static TQColor severityColor(int severity) { if (severity == StyleGuideViolation::Error) { @@ -310,7 +310,7 @@ static QColor severityColor(int severity) } else if (severity == StyleGuideViolation::AccelConflict) { - return QColor(255, 128, 0); + return TQColor(255, 128, 0); } else if (severity == StyleGuideViolation::AccelSuggestion) { @@ -318,7 +318,7 @@ static QColor severityColor(int severity) } else if (severity == StyleGuideViolation::Untranslated) { - return QColor(255, 0, 255); + return TQColor(255, 0, 255); } else { @@ -327,7 +327,7 @@ static QColor severityColor(int severity) } // Removes '&' style accelerators from text strings -static void removeAccelerators(QString &str) +static void removeAccelerators(TQString &str) { for (unsigned int p = 0; p < str.length(); p++) { @@ -341,19 +341,19 @@ static void removeAccelerators(QString &str) } -static void removeXX(QString &str) +static void removeXX(TQString &str) { str.replace("xx",""); // simple but atm best working } -static QString removedXX(QString str) +static TQString removedXX(TQString str) { if (xxMode) removeXX(str); return str; } -static QString stripAccelViolations(QString str) +static TQString stripAccelViolations(TQString str) { int conflict_pos = str.find("(&&)"); if (conflict_pos >= 0) @@ -371,7 +371,7 @@ static QString stripAccelViolations(QString str) } // Must be passed a string with its accelerators removed -QString findAccelViolations(QString str, QValueVector<StyleGuideViolation> &violations) +TQString findAccelViolations(TQString str, TQValueVector<StyleGuideViolation> &violations) { int conflict_pos = str.find("(&)"); @@ -397,7 +397,7 @@ QString findAccelViolations(QString str, QValueVector<StyleGuideViolation> &viol return str; } -QString findUntranslatedViolations(QString str, QValueVector<StyleGuideViolation> &violations) +TQString findUntranslatedViolations(TQString str, TQValueVector<StyleGuideViolation> &violations) { if (str.find("xx")!=-1) removeXX(str); @@ -409,9 +409,9 @@ QString findUntranslatedViolations(QString str, QValueVector<StyleGuideViolation return str; } -static QValueVector<StyleGuideViolation> checkSentenceStyle(QString str, ColonMode mode = ColonlessWidget, AccelMode accelMode = HasAccels) +static TQValueVector<StyleGuideViolation> checkSentenceStyle(TQString str, ColonMode mode = ColonlessWidget, AccelMode accelMode = HasAccels) { - QValueVector<StyleGuideViolation> violations; + TQValueVector<StyleGuideViolation> violations; bool afterWhiteSpace = true; bool firstChar = true; bool inQuote = false; @@ -486,7 +486,7 @@ static QValueVector<StyleGuideViolation> checkSentenceStyle(QString str, ColonM if (afterWhiteSpace) //We don't check for fOO and things like that, just first letters.. { // Try to extract the whole word.. - QString word = QString::null; + TQString word = TQString::null; for (unsigned int l = c+1; l<str.length(); l++) { if (!str[l].isLetter() && !str[l].isNumber() && str[l] != '&' && str[l] != '-') @@ -517,12 +517,12 @@ static QValueVector<StyleGuideViolation> checkSentenceStyle(QString str, ColonM } } } - else if (str[c].category() == QChar::Letter_Lowercase) //Lowercase character.. + else if (str[c].category() == TQChar::Letter_Lowercase) //Lowercase character.. { if (firstChar) violations.push_back(c); } - else if (str[c].category() == QChar::Letter_Uppercase) + else if (str[c].category() == TQChar::Letter_Uppercase) { if (!firstChar) //A possible violation -- can be a proper name.. { @@ -532,7 +532,7 @@ static QValueVector<StyleGuideViolation> checkSentenceStyle(QString str, ColonM { if (str[d].isSpace() ) break; - if (str[d].category() == QChar::Letter_Uppercase) + if (str[d].category() == TQChar::Letter_Uppercase) { acronym = true; break; @@ -581,9 +581,9 @@ static QValueVector<StyleGuideViolation> checkSentenceStyle(QString str, ColonM return violations; } -static QValueVector<StyleGuideViolation> checkTitleStyle(QString str, TitleType titleType = ShortTitle, AccelMode accelMode = NoAccels) +static TQValueVector<StyleGuideViolation> checkTitleStyle(TQString str, TitleType titleType = ShortTitle, AccelMode accelMode = NoAccels) { - QValueVector<StyleGuideViolation> violations; + TQValueVector<StyleGuideViolation> violations; bool afterWhiteSpace = true; if (xxMode) @@ -646,7 +646,7 @@ static QValueVector<StyleGuideViolation> checkTitleStyle(QString str, TitleType bool lastWord = false; //Now, try to extract the whole word.. - QString word = QString::null; + TQString word = TQString::null; for (unsigned int l = c+1; l<str.length(); l++) { if (!str[l].isLetter() && !str[l].isNumber() && str[l] != '&' && str[l] != '-') @@ -664,7 +664,7 @@ static QValueVector<StyleGuideViolation> checkTitleStyle(QString str, TitleType lastWord = true; } - QString lower_word = word.lower(); + TQString lower_word = word.lower(); // Check if it's in the explicit case word list const char *correctWord = ExplicitCaseWords::words()->find(lower_word); @@ -689,12 +689,12 @@ static QValueVector<StyleGuideViolation> checkTitleStyle(QString str, TitleType else if (c && !lastWord && LowerCaseWords::words()->find(word.lower())) { // We're a lowercase word - if (str[c].category() == QChar::Letter_Uppercase) + if (str[c].category() == TQChar::Letter_Uppercase) violations.push_back(c); } else { - if (str[c].category() == QChar::Letter_Lowercase) + if (str[c].category() == TQChar::Letter_Lowercase) violations.push_back(c); } } @@ -707,7 +707,7 @@ static QValueVector<StyleGuideViolation> checkTitleStyle(QString str, TitleType } -static void renderViolations(const QValueVector<StyleGuideViolation>& violations, QPainter* p, QRect r, int flags, QString text) +static void renderViolations(const TQValueVector<StyleGuideViolation>& violations, TQPainter* p, TQRect r, int flags, TQString text) { if (xxMode) @@ -716,20 +716,20 @@ static void renderViolations(const QValueVector<StyleGuideViolation>& violations if (violations.size()>0) { p->save(); - QFontMetrics qfm = p->fontMetrics (); + TQFontMetrics qfm = p->fontMetrics (); - QString parStr = text; + TQString parStr = text; int len = text.length(); /***** - Begin code snipped from QPainter, somewhat modified + Begin code snipped from TQPainter, somewhat modified */ // str.setLength() always does a deep copy, so the replacement code below is safe. parStr.setLength( len ); // compatible behaviour to the old implementation. Replace tabs by spaces - QChar *chr = (QChar*)parStr.unicode(); + TQChar *chr = (TQChar*)parStr.unicode(); int l = len; while ( l-- ) { @@ -763,14 +763,14 @@ static void renderViolations(const QValueVector<StyleGuideViolation>& violations /***** - end code snipped from QPainter... + end code snipped from TQPainter... */ int yt = yoff - h; int yb = yoff;; - QRect bnd(xoff, yoff - h, w, h); + TQRect bnd(xoff, yoff - h, w, h); for (unsigned int v = 0; v < violations.size(); v++) { @@ -814,22 +814,22 @@ static void renderViolations(const QValueVector<StyleGuideViolation>& violations StyleCheckTitleWatcher::StyleCheckTitleWatcher() { - QTimer* checkTimer = new QTimer(this); - connect( checkTimer, SIGNAL(timeout()), this, SLOT(slotCheck()) ); + TQTimer* checkTimer = new TQTimer(this); + connect( checkTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotCheck()) ); checkTimer->start(1000); } -void StyleCheckTitleWatcher::addWatched(QWidget* w) +void StyleCheckTitleWatcher::addWatched(TQWidget* w) { watched.push_back(w); watchedTitles.push_back(w->caption()); } -QString StyleCheckTitleWatcher::cleanErrorMarkers(QString in) +TQString StyleCheckTitleWatcher::cleanErrorMarkers(TQString in) { //We add # to denote an error...So now remove it.. It helps us check whether it's the same caption as before.. - QString out = ""; + TQString out = ""; for (unsigned int c = 0; c < in.length(); c++) { if (in[c] != '|') @@ -846,16 +846,16 @@ void StyleCheckTitleWatcher::slotCheck() if (!watched[c].isNull() ) { - QString cleaned = cleanErrorMarkers(watched[c]->caption()); + TQString cleaned = cleanErrorMarkers(watched[c]->caption()); if (cleaned != watchedTitles[c]) { watchedTitles[c] = watched[c]->caption(); - QValueVector<StyleGuideViolation> violations = checkTitleStyle(watched[c]->caption(), LongTitle, NoAccels); + TQValueVector<StyleGuideViolation> violations = checkTitleStyle(watched[c]->caption(), LongTitle, NoAccels); if (violations.size() == 0) continue; - QString out = ""; - QString in = watched[c]->caption(); + TQString out = ""; + TQString in = watched[c]->caption(); int prev = -1; for (unsigned int v = 0; v < violations.size(); v++) { @@ -879,10 +879,10 @@ StyleCheckStyle::StyleCheckStyle( ) : KStyle( 0 , ThreeButtonScrollBar ) { hoverWidget = 0L; - topLevelAccelManageTimer = new QTimer(this); - connect(topLevelAccelManageTimer, SIGNAL(timeout()), this, SLOT(slotAccelManage())); + topLevelAccelManageTimer = new TQTimer(this); + connect(topLevelAccelManageTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAccelManage())); watcher = new StyleCheckTitleWatcher; - xxMode = (QString(getenv("KDE_LANG"))=="xx"); + xxMode = (TQString(getenv("KDE_LANG"))=="xx"); } @@ -892,7 +892,7 @@ StyleCheckStyle::~StyleCheckStyle() } //We walk down the widget tree until we find something we render, and sic KAccelManager in programmer's mode on those -void StyleCheckStyle::accelManageRecursive(QWidget* widget) +void StyleCheckStyle::accelManageRecursive(TQWidget* widget) { if (&widget->style() == this) { @@ -900,16 +900,16 @@ void StyleCheckStyle::accelManageRecursive(QWidget* widget) return; } - const QObjectList* children = widget->children(); + const TQObjectList* children = widget->children(); if (!children) return; - QObjectListIterator iter(*children); + TQObjectListIterator iter(*children); - QObject* walk; + TQObject* walk; while ((walk = iter.current())) { if (walk->isWidgetType()) - accelManageRecursive(static_cast<QWidget*>(walk)); + accelManageRecursive(static_cast<TQWidget*>(walk)); ++iter; } } @@ -918,13 +918,13 @@ void StyleCheckStyle::accelManageRecursive(QWidget* widget) void StyleCheckStyle::slotAccelManage() { //Walk through top-levels - QWidgetList* topLevels = QApplication::topLevelWidgets(); + TQWidgetList* topLevels = TQApplication::topLevelWidgets(); if (!topLevels) return; - QWidgetListIt iter(*topLevels); + TQWidgetListIt iter(*topLevels); - QWidget* walk; + TQWidget* walk; while ((walk = iter.current())) { accelManageRecursive(walk); @@ -934,7 +934,7 @@ void StyleCheckStyle::slotAccelManage() } -void StyleCheckStyle::polish(QWidget* widget) +void StyleCheckStyle::polish(TQWidget* widget) { /* Having a global view on the widget makes accel easier to catch. However, just intruding on the main window @@ -945,21 +945,21 @@ void StyleCheckStyle::polish(QWidget* widget) // // Put in order of highest occurance to maximise hit rate - if (widget->inherits("QPushButton")) { + if (widget->inherits("TQPushButton")) { widget->installEventFilter(this); } - if (widget->inherits("QLabel")) + if (widget->inherits("TQLabel")) { widget->installEventFilter(this); } - if (widget->inherits("QGroupBox")) + if (widget->inherits("TQGroupBox")) { widget->installEventFilter(this); } - if (widget->inherits("QMainWindow") || widget->inherits("QDialog" ) ) + if (widget->inherits("TQMainWindow") || widget->inherits("TQDialog" ) ) { watcher->addWatched(widget); } @@ -968,18 +968,18 @@ void StyleCheckStyle::polish(QWidget* widget) } -void StyleCheckStyle::unPolish(QWidget* widget) +void StyleCheckStyle::unPolish(TQWidget* widget) { - if (widget->inherits("QPushButton")) { + if (widget->inherits("TQPushButton")) { widget->removeEventFilter(this); } - if (widget->inherits("QLabel")) + if (widget->inherits("TQLabel")) { widget->removeEventFilter(this); } - if (widget->inherits("QGroupBox")) + if (widget->inherits("TQGroupBox")) { widget->removeEventFilter(this); } @@ -993,11 +993,11 @@ void StyleCheckStyle::unPolish(QWidget* widget) // This function draws primitive elements as well as their masks. void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, - QPainter *p, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { bool down = flags & Style_Down; bool on = flags & Style_On; @@ -1026,7 +1026,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, r.rect(&x, &y, &w, &h); int x2 = x+w-1; int y2 = y+h-1; - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); // Outer frame (round style) p->setPen(cg.shadow()); @@ -1058,10 +1058,10 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, if ( sunken ) kDrawBeButton( p, x, y, w, h, cg, true, - &cg.brush(QColorGroup::Mid) ); + &cg.brush(TQColorGroup::Mid) ); else if ( flags & Style_MouseOver ) { - QBrush brush(cg.button().light(110)); + TQBrush brush(cg.button().light(110)); kDrawBeButton( p, x, y, w, h, cg, false, &brush ); } @@ -1071,7 +1071,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, else kDrawBeButton(p, x, y, w, h, cg, false, - &cg.brush(QColorGroup::Button)); + &cg.brush(TQColorGroup::Button)); break; } @@ -1101,7 +1101,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, if (sunken) p->fillRect(x+2, y+2, w-4, h-4, cg.button()); else - renderGradient( p, QRect(x+2, y+2, w-4, h-4), + renderGradient( p, TQRect(x+2, y+2, w-4, h-4), cg.button(), flags & Style_Horizontal ); } break; @@ -1121,8 +1121,8 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, case PE_HeaderSection: { // Temporary solution for the proper orientation of gradients. bool horizontal = true; - if (p && p->device()->devType() == QInternal::Widget) { - QHeader* hdr = dynamic_cast<QHeader*>(p->device()); + if (p && p->device()->devType() == TQInternal::Widget) { + TQHeader* hdr = dynamic_cast<TQHeader*>(p->device()); if (hdr) horizontal = hdr->orientation() == Horizontal; } @@ -1132,7 +1132,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, bool sunken = on || down; int x2 = x+w-1; int y2 = y+h-1; - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); // Bevel p->setPen(sunken ? cg.mid() : cg.light()); @@ -1148,7 +1148,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, if (sunken) p->fillRect(x+1, y+1, w-3, h-3, cg.button()); else - renderGradient( p, QRect(x+1, y+1, w-3, h-3), + renderGradient( p, TQRect(x+1, y+1, w-3, h-3), cg.button(), !horizontal ); p->setPen( oldPen ); break; @@ -1212,12 +1212,12 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, if (flags & Style_Horizontal) { p->drawLine(x, y, x2, y); p->drawLine(x, y2, x2, y2); - renderGradient(p, QRect(x, y+1, w, h-2), + renderGradient(p, TQRect(x, y+1, w, h-2), cg.mid(), false); } else { p->drawLine(x, y, x, y2); p->drawLine(x2, y, x2, y2); - renderGradient(p, QRect(x+1, y, w-2, h), + renderGradient(p, TQRect(x+1, y, w-2, h), cg.mid(), true); } break; @@ -1252,7 +1252,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, bool nochange = flags & Style_NoChange; if (xBmp.isNull()) { - xBmp = QBitmap(7, 7, x_bits, true); + xBmp = TQBitmap(7, 7, x_bits, true); xBmp.setMask(xBmp); } @@ -1306,10 +1306,10 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, case PE_ExclusiveIndicator: { if (lightBmp.isNull()) { - lightBmp = QBitmap(13, 13, radiooff_light_bits, true); - grayBmp = QBitmap(13, 13, radiooff_gray_bits, true); - dgrayBmp = QBitmap(13, 13, radiooff_dgray_bits, true); - centerBmp = QBitmap(13, 13, radiooff_center_bits, true); + lightBmp = TQBitmap(13, 13, radiooff_light_bits, true); + grayBmp = TQBitmap(13, 13, radiooff_gray_bits, true); + dgrayBmp = TQBitmap(13, 13, radiooff_dgray_bits, true); + centerBmp = TQBitmap(13, 13, radiooff_center_bits, true); centerBmp.setMask( centerBmp ); } @@ -1326,7 +1326,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, // Indicator "dot" if ( on ) { - QColor color = flags & Style_NoChange ? + TQColor color = flags & Style_NoChange ? cg.dark() : cg.text(); p->setPen(color); @@ -1345,7 +1345,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, // ------------------------------------------------------------------- case PE_ExclusiveIndicatorMask: { if (maskBmp.isNull()) { - maskBmp = QBitmap(13, 13, radiomask_bits, true); + maskBmp = TQBitmap(13, 13, radiomask_bits, true); maskBmp.setMask(maskBmp); } @@ -1380,7 +1380,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, p->setPen(cg.mid()); p->drawLine(x2-1, y+1, x2-1, y2-1); p->drawLine(x+1, y2-1, x2-1, y2-1); - p->fillRect(x+3, y+3, w-5, h-5, cg.brush(QColorGroup::Background)); + p->fillRect(x+3, y+3, w-5, h-5, cg.brush(TQColorGroup::Background)); break; } @@ -1396,7 +1396,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, : opt.lineWidth(); if (lw == 2) { - QPen oldPen = p->pen(); + TQPen oldPen = p->pen(); int x,y,w,h; r.rect(&x, &y, &w, &h); int x2 = x+w-1; @@ -1438,13 +1438,13 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, p->drawLine(x2, r.y(), x2, y2); // ### Qt should specify Style_Horizontal where appropriate - renderGradient( p, QRect(r.x()+1, r.y()+1, x2-1, y2-1), + renderGradient( p, TQRect(r.x()+1, r.y()+1, x2-1, y2-1), cg.button(), (r.width() < r.height()) && (pe != PE_PanelMenuBar) ); } else { - renderGradient( p, QRect(r.x(), r.y(), x2, y2), + renderGradient( p, TQRect(r.x(), r.y(), x2, y2), cg.button(), (r.width() < r.height()) && (pe != PE_PanelMenuBar) ); } @@ -1480,7 +1480,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, // ------------------------------------------------------------------- if (pe >= PE_ArrowUp && pe <= PE_ArrowLeft) { - QPointArray a; + TQPointArray a; // HighColor & Default arrows switch(pe) { @@ -1527,12 +1527,12 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe, void StyleCheckStyle::drawKStylePrimitive( KStylePrimitive kpe, - QPainter* p, - const QWidget* widget, - const QRect &r, - const QColorGroup &cg, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption &opt ) const + const TQStyleOption &opt ) const { switch ( kpe ) { @@ -1613,15 +1613,15 @@ void StyleCheckStyle::drawKStylePrimitive( KStylePrimitive kpe, // SLIDER GROOVE // ------------------------------------------------------------------- case KPE_SliderGroove: { - const QSlider* slider = (const QSlider*)widget; + const TQSlider* slider = (const TQSlider*)widget; bool horizontal = slider->orientation() == Horizontal; int gcenter = (horizontal ? r.height() : r.width()) / 2; - QRect gr; + TQRect gr; if (horizontal) - gr = QRect(r.x(), r.y()+gcenter-3, r.width(), 7); + gr = TQRect(r.x(), r.y()+gcenter-3, r.width(), 7); else - gr = QRect(r.x()+gcenter-3, r.y(), 7, r.height()); + gr = TQRect(r.x()+gcenter-3, r.y(), 7, r.height()); int x,y,w,h; gr.rect(&x, &y, &w, &h); @@ -1647,7 +1647,7 @@ void StyleCheckStyle::drawKStylePrimitive( KStylePrimitive kpe, // SLIDER HANDLE // ------------------------------------------------------------------- case KPE_SliderHandle: { - const QSlider* slider = (const QSlider*)widget; + const TQSlider* slider = (const TQSlider*)widget; bool horizontal = slider->orientation() == Horizontal; int x,y,w,h; r.rect(&x, &y, &w, &h); @@ -1673,7 +1673,7 @@ void StyleCheckStyle::drawKStylePrimitive( KStylePrimitive kpe, p->setPen(cg.mid()); p->drawLine(x+3, y2-2, x2-2, y2-2); p->drawLine(x2-2, y+3, x2-2, y2-2); - renderGradient(p, QRect(x+3, y+3, w-6, h-6), + renderGradient(p, TQRect(x+3, y+3, w-6, h-6), cg.button(), !horizontal); // Paint riffles @@ -1706,12 +1706,12 @@ void StyleCheckStyle::drawKStylePrimitive( KStylePrimitive kpe, void StyleCheckStyle::drawControl( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { switch (element) { @@ -1721,8 +1721,8 @@ void StyleCheckStyle::drawControl( ControlElement element, if ( widget == hoverWidget ) flags |= Style_MouseOver; - QPushButton *button = (QPushButton*) widget; - QRect br = r; + TQPushButton *button = (TQPushButton*) widget; + TQRect br = r; bool btnDefault = button->isDefault(); if ( btnDefault || button->autoDefault() ) { @@ -1743,7 +1743,7 @@ void StyleCheckStyle::drawControl( ControlElement element, // PUSHBUTTON LABEL // ------------------------------------------------------------------- case CE_PushButtonLabel: { - const QPushButton* button = (const QPushButton*)widget; + const TQPushButton* button = (const TQPushButton*)widget; bool active = button->isOn() || button->isDown(); int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -1758,61 +1758,61 @@ void StyleCheckStyle::drawControl( ControlElement element, // Does the button have a popup menu? if ( button->isMenuButton() ) { int dx = pixelMetric( PM_MenuButtonIndicator, widget ); - drawPrimitive( PE_ArrowDown, p, QRect(x + w - dx - 2, y + 2, dx, h - 4), + drawPrimitive( PE_ArrowDown, p, TQRect(x + w - dx - 2, y + 2, dx, h - 4), cg, flags, opt ); w -= dx; } // Draw the icon if there is one if ( button->iconSet() && !button->iconSet()->isNull() ) { - QIconSet::Mode mode = QIconSet::Disabled; - QIconSet::State state = QIconSet::Off; + TQIconSet::Mode mode = TQIconSet::Disabled; + TQIconSet::State state = TQIconSet::Off; if (button->isEnabled()) - mode = button->hasFocus() ? QIconSet::Active : QIconSet::Normal; + mode = button->hasFocus() ? TQIconSet::Active : TQIconSet::Normal; if (button->isToggleButton() && button->isOn()) - state = QIconSet::On; + state = TQIconSet::On; - QPixmap pixmap = button->iconSet()->pixmap( QIconSet::Small, mode, state ); + TQPixmap pixmap = button->iconSet()->pixmap( TQIconSet::Small, mode, state ); p->drawPixmap( x + 4, y + h / 2 - pixmap.height() / 2, pixmap ); int pw = pixmap.width(); x += pw + 4; w -= pw + 4; } - QValueVector<StyleGuideViolation> violations = checkTitleStyle(button->text(), ShortTitle, HasAccels); - renderViolations(violations, p, QRect(x,y,w,h), AlignCenter | ShowPrefix, button->text()); + TQValueVector<StyleGuideViolation> violations = checkTitleStyle(button->text(), ShortTitle, HasAccels); + renderViolations(violations, p, TQRect(x,y,w,h), AlignCenter | ShowPrefix, button->text()); // Make the label indicate if the button is a default button or not if ( active || button->isDefault() ) { // Draw "fake" bold text - this enables the font metrics to remain - // the same as computed in QPushButton::sizeHint(), but gives + // the same as computed in TQPushButton::sizeHint(), but gives // a reasonable bold effect. int i; // Text shadow if (button->isEnabled()) // Don't draw double-shadow when disabled for(i=0; i<2; i++) - drawItem( p, QRect(x+i+1, y+1, w, h), AlignCenter | ShowPrefix, + drawItem( p, TQRect(x+i+1, y+1, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), button->pixmap(), removedXX(stripAccelViolations(button->text())), -1, active ? &button->colorGroup().dark() : &button->colorGroup().mid() ); // Normal Text for(i=0; i<2; i++) - drawItem( p, QRect(x+i, y, w, h), AlignCenter | ShowPrefix, + drawItem( p, TQRect(x+i, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), button->pixmap(), removedXX(stripAccelViolations(button->text())), -1, active ? &button->colorGroup().light() : &button->colorGroup().buttonText() ); } else - drawItem( p, QRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), + drawItem( p, TQRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(), button->isEnabled(), button->pixmap(), removedXX(stripAccelViolations(button->text())), -1, active ? &button->colorGroup().light() : &button->colorGroup().buttonText() ); // Draw a focus rect if the button has focus if ( flags & Style_HasFocus ) drawPrimitive( PE_FocusRect, p, - QStyle::visualRect(subRect(SR_PushButtonFocusRect, widget), widget), + TQStyle::visualRect(subRect(SR_PushButtonFocusRect, widget), widget), cg, flags ); break; } @@ -1822,15 +1822,15 @@ void StyleCheckStyle::drawControl( ControlElement element, if ( opt.isDefault() ) break; - const QTabBar * tb = (const QTabBar *) widget; - QTab * t = opt.tab(); + const TQTabBar * tb = (const TQTabBar *) widget; + TQTab * t = opt.tab(); - QRect tr = r; + TQRect tr = r; if ( t->identifier() == tb->currentTab() ) tr.setBottom( tr.bottom() - - pixelMetric( QStyle::PM_DefaultFrameWidth, tb ) ); + pixelMetric( TQStyle::PM_DefaultFrameWidth, tb ) ); - QValueVector<StyleGuideViolation> violations = checkTitleStyle(t->text(), ShortTitle, HasAccels); + TQValueVector<StyleGuideViolation> violations = checkTitleStyle(t->text(), ShortTitle, HasAccels); renderViolations(violations, p, r, AlignCenter |ShowPrefix, t->text()); drawItem( p, tr, AlignCenter | ShowPrefix, cg, @@ -1844,11 +1844,11 @@ void StyleCheckStyle::drawControl( ControlElement element, case CE_CheckBoxLabel: { - const QCheckBox* checkbox = static_cast<const QCheckBox*>(widget); + const TQCheckBox* checkbox = static_cast<const TQCheckBox*>(widget); - int alignment = QApplication::reverseLayout() ? AlignRight : AlignLeft; + int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft; - QValueVector<StyleGuideViolation> violations = checkSentenceStyle(checkbox->text()); + TQValueVector<StyleGuideViolation> violations = checkSentenceStyle(checkbox->text()); renderViolations(violations, p, r, alignment | AlignVCenter | ShowPrefix, checkbox->text()); @@ -1857,7 +1857,7 @@ void StyleCheckStyle::drawControl( ControlElement element, if (flags & Style_HasFocus) { - QRect fr = visualRect(subRect(SR_CheckBoxFocusRect, widget), widget); + TQRect fr = visualRect(subRect(SR_CheckBoxFocusRect, widget), widget); drawPrimitive(PE_FocusRect, p, fr, cg, flags); } break; @@ -1865,11 +1865,11 @@ void StyleCheckStyle::drawControl( ControlElement element, case CE_RadioButtonLabel: { - const QRadioButton* rb = static_cast<const QRadioButton*>(widget); + const TQRadioButton* rb = static_cast<const TQRadioButton*>(widget); - int alignment = QApplication::reverseLayout() ? AlignRight : AlignLeft; + int alignment = TQApplication::reverseLayout() ? AlignRight : AlignLeft; - QValueVector<StyleGuideViolation> violations = checkSentenceStyle(rb->text()); + TQValueVector<StyleGuideViolation> violations = checkSentenceStyle(rb->text()); renderViolations(violations, p, r,alignment | AlignVCenter | ShowPrefix, rb->text()); @@ -1878,7 +1878,7 @@ void StyleCheckStyle::drawControl( ControlElement element, if (flags & Style_HasFocus) { - QRect fr = visualRect(subRect(SR_CheckBoxFocusRect, widget), widget); + TQRect fr = visualRect(subRect(SR_CheckBoxFocusRect, widget), widget); drawPrimitive(PE_FocusRect, p, fr, cg, flags); } break; @@ -1889,21 +1889,21 @@ void StyleCheckStyle::drawControl( ControlElement element, // ------------------------------------------------------------------- case CE_MenuBarItem: { - QMenuBar *mb = (QMenuBar*)widget; - QMenuItem *mi = opt.menuItem(); - QRect pr = mb->rect(); + TQMenuBar *mb = (TQMenuBar*)widget; + TQMenuItem *mi = opt.menuItem(); + TQRect pr = mb->rect(); bool active = flags & Style_Active; bool focused = flags & Style_HasFocus; if ( active && focused ) qDrawShadePanel(p, r.x(), r.y(), r.width(), r.height(), - cg, true, 1, &cg.brush(QColorGroup::Midlight)); + cg, true, 1, &cg.brush(TQColorGroup::Midlight)); else renderGradient( p, r, cg.button(), false, r.x(), r.y()-1, pr.width()-2, pr.height()-2); - QValueVector<StyleGuideViolation> violations = checkTitleStyle(mi->text(), ShortTitle, HasAccels); + TQValueVector<StyleGuideViolation> violations = checkTitleStyle(mi->text(), ShortTitle, HasAccels); renderViolations(violations, p, r, AlignCenter | AlignVCenter | ShowPrefix, mi->text()); drawItem( p, r, AlignCenter | AlignVCenter | ShowPrefix @@ -1917,14 +1917,14 @@ void StyleCheckStyle::drawControl( ControlElement element, // POPUPMENU ITEM // ------------------------------------------------------------------- case CE_PopupMenuItem: { - const QPopupMenu *popupmenu = (const QPopupMenu *) widget; + const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget; - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); if ( !mi ) { - // Don't leave blank holes if we set NoBackground for the QPopupMenu. + // Don't leave blank holes if we set NoBackground for the TQPopupMenu. // This only happens when the popupMenu spans more than one column. if (! (widget->erasePixmap() && !widget->erasePixmap()->isNull()) ) - p->fillRect(r, cg.brush(QColorGroup::Button) ); + p->fillRect(r, cg.brush(TQColorGroup::Button) ); break; } @@ -1934,7 +1934,7 @@ void StyleCheckStyle::drawControl( ControlElement element, bool checkable = popupmenu->isCheckable(); bool active = flags & Style_Active; bool etchtext = styleHint( SH_EtchDisabledText ); - bool reverse = QApplication::reverseLayout(); + bool reverse = TQApplication::reverseLayout(); int x, y, w, h; r.rect( &x, &y, &w, &h ); @@ -1953,7 +1953,7 @@ void StyleCheckStyle::drawControl( ControlElement element, // Draw the menu item background if ( active ) qDrawShadePanel( p, x, y, w, h, cg, true, 1, - &cg.brush(QColorGroup::Midlight) ); + &cg.brush(TQColorGroup::Midlight) ); // Draw the transparency pixmap else if ( widget->erasePixmap() && !widget->erasePixmap()->isNull() ) p->drawPixmap( x, y, *widget->erasePixmap(), x, y, w, h ); @@ -1963,23 +1963,23 @@ void StyleCheckStyle::drawControl( ControlElement element, // Do we have an icon? if ( mi->iconSet() ) { - QIconSet::Mode mode; - QRect cr = visualRect( QRect(x, y, checkcol, h), r ); + TQIconSet::Mode mode; + TQRect cr = visualRect( TQRect(x, y, checkcol, h), r ); // Select the correct icon from the iconset if ( active ) - mode = enabled ? QIconSet::Active : QIconSet::Disabled; + mode = enabled ? TQIconSet::Active : TQIconSet::Disabled; else - mode = enabled ? QIconSet::Normal : QIconSet::Disabled; + mode = enabled ? TQIconSet::Normal : TQIconSet::Disabled; // Do we have an icon and are checked at the same time? // Then draw a "pressed" background behind the icon if ( checkable && !active && mi->isChecked() ) qDrawShadePanel( p, cr.x(), cr.y(), cr.width(), cr.height(), - cg, true, 1, &cg.brush(QColorGroup::Midlight) ); + cg, true, 1, &cg.brush(TQColorGroup::Midlight) ); // Draw the icon - QPixmap pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode ); - QRect pmr( 0, 0, pixmap.width(), pixmap.height() ); + TQPixmap pixmap = mi->iconSet()->pixmap( TQIconSet::Small, mode ); + TQRect pmr( 0, 0, pixmap.width(), pixmap.height() ); pmr.moveCenter( cr.center() ); p->drawPixmap( pmr.topLeft(), pixmap ); } @@ -1992,13 +1992,13 @@ void StyleCheckStyle::drawControl( ControlElement element, // if it's active the "pressed" background is already drawn if ( ! active ) qDrawShadePanel( p, cx, y, checkcol, h, cg, true, 1, - &cg.brush(QColorGroup::Midlight) ); + &cg.brush(TQColorGroup::Midlight) ); // Draw the checkmark SFlags cflags = Style_Default; cflags |= active ? Style_Enabled : Style_On; - drawPrimitive( PE_CheckMark, p, QRect( cx + itemFrame, y + itemFrame, + drawPrimitive( PE_CheckMark, p, TQRect( cx + itemFrame, y + itemFrame, checkcol - itemFrame*2, h - itemFrame*2), cg, cflags ); } @@ -2020,7 +2020,7 @@ void StyleCheckStyle::drawControl( ControlElement element, // This color will be used instead of the above if the menu item // is active and disabled at the same time. (etched text) - QColor discol = cg.mid(); + TQColor discol = cg.mid(); // Does the menu item draw it's own label? if ( mi->custom() ) { @@ -2039,14 +2039,14 @@ void StyleCheckStyle::drawControl( ControlElement element, p->restore(); } else { - QValueVector<StyleGuideViolation> ourViolations; + TQValueVector<StyleGuideViolation> ourViolations; - QString tmpStr = mi->text(); + TQString tmpStr = mi->text(); removeAccelerators(tmpStr); findAccelViolations(tmpStr, ourViolations); // The menu item doesn't draw it's own label - QString s = stripAccelViolations(mi->text()); + TQString s = stripAccelViolations(mi->text()); // Does the menu item have a text label? if ( !s.isNull() ) { @@ -2071,9 +2071,9 @@ void StyleCheckStyle::drawControl( ControlElement element, s = s.left( t ); } - QValueVector<StyleGuideViolation> violations = checkTitleStyle(s, ShortTitle, HasAccels); - renderViolations(violations, p, QRect(xp, y+m, tw, h-2*m), text_flags, s); - renderViolations(ourViolations, p, QRect(xp, y+m, tw, h-2*m), text_flags, s); + TQValueVector<StyleGuideViolation> violations = checkTitleStyle(s, ShortTitle, HasAccels); + renderViolations(violations, p, TQRect(xp, y+m, tw, h-2*m), text_flags, s); + renderViolations(ourViolations, p, TQRect(xp, y+m, tw, h-2*m), text_flags, s); // Draw the left part of the label (or the whole label @@ -2092,7 +2092,7 @@ void StyleCheckStyle::drawControl( ControlElement element, // The menu item doesn't have a text label // Check if it has a pixmap instead else if ( mi->pixmap() ) { - QPixmap *pixmap = mi->pixmap(); + TQPixmap *pixmap = mi->pixmap(); // Draw the pixmap if ( pixmap->depth() == 1 ) @@ -2111,7 +2111,7 @@ void StyleCheckStyle::drawControl( ControlElement element, if ( mi->popup() ) { PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight; int dim = pixelMetric(PM_MenuButtonIndicator); - QRect vr = visualRect( QRect( x + w - arrowHMargin - 2*itemFrame - dim, + TQRect vr = visualRect( TQRect( x + w - arrowHMargin - 2*itemFrame - dim, y + h / 2 - dim / 2, dim, dim), r ); // Draw an arrow at the far end of the menu item @@ -2119,7 +2119,7 @@ void StyleCheckStyle::drawControl( ControlElement element, if ( enabled ) discol = cg.buttonText(); - QColorGroup g2( discol, cg.highlight(), white, white, + TQColorGroup g2( discol, cg.highlight(), white, white, enabled ? white : discol, discol, white ); drawPrimitive( arrow, p, vr, g2, Style_Enabled ); @@ -2132,28 +2132,28 @@ void StyleCheckStyle::drawControl( ControlElement element, case CE_HeaderLabel: { - //Most of code here shamelessly lifted from QCommonStyle. - QRect rect = r; - const QHeader* header = static_cast<const QHeader*>(widget); + //Most of code here shamelessly lifted from TQCommonStyle. + TQRect rect = r; + const TQHeader* header = static_cast<const TQHeader*>(widget); int section = opt.headerSection(); - QIconSet* icon = header->iconSet( section ); + TQIconSet* icon = header->iconSet( section ); if ( icon ) { - QPixmap pixmap = icon->pixmap( QIconSet::Small, - flags & Style_Enabled ? QIconSet::Normal : QIconSet::Disabled ); + TQPixmap pixmap = icon->pixmap( TQIconSet::Small, + flags & Style_Enabled ? TQIconSet::Normal : TQIconSet::Disabled ); int pixw = pixmap.width(); int pixh = pixmap.height(); // "pixh - 1" because of tricky integer division - QRect pixRect = rect; + TQRect pixRect = rect; pixRect.setY( rect.center().y() - (pixh - 1) / 2 ); drawItem ( p, pixRect, AlignVCenter, cg, flags & Style_Enabled, - &pixmap, QString::null ); + &pixmap, TQString::null ); rect.setLeft( rect.left() + pixw + 2 ); } - QString s = header->label( section ); + TQString s = header->label( section ); - QValueVector<StyleGuideViolation> violations = checkTitleStyle(s, ShortTitle, NoAccels); + TQValueVector<StyleGuideViolation> violations = checkTitleStyle(s, ShortTitle, NoAccels); renderViolations(violations, p, rect, AlignVCenter, s); @@ -2170,10 +2170,10 @@ void StyleCheckStyle::drawControl( ControlElement element, void StyleCheckStyle::drawControlMask( ControlElement element, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& opt ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& opt ) const { switch (element) { @@ -2185,7 +2185,7 @@ void StyleCheckStyle::drawControlMask( ControlElement element, QCOORD corners[] = { x1,y1, x2,y1, x1,y2, x2,y2 }; p->fillRect( r, color1 ); p->setPen( color0 ); - p->drawPoints( QPointArray(4, corners) ); + p->drawPoints( TQPointArray(4, corners) ); break; } @@ -2196,14 +2196,14 @@ void StyleCheckStyle::drawControlMask( ControlElement element, void StyleCheckStyle::drawComplexControl( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QColorGroup &cg, + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, - const QStyleOption& opt ) const + const TQStyleOption& opt ) const { switch(control) { @@ -2234,7 +2234,7 @@ void StyleCheckStyle::drawComplexControl( ComplexControl control, p->drawPoint(x2,y); p->drawPoint(x2,y2); - renderGradient( p, QRect(x+2, y+2, w-4, h-4), + renderGradient( p, TQRect(x+2, y+2, w-4, h-4), cg.button(), false); p->setPen(sunken ? cg.light() : cg.mid()); @@ -2246,7 +2246,7 @@ void StyleCheckStyle::drawComplexControl( ComplexControl control, p->drawLine(x+1, y+2, x+1, y2-2); // Get the button bounding box - QRect ar = QStyle::visualRect( + TQRect ar = TQStyle::visualRect( querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow), widget ); @@ -2264,8 +2264,8 @@ void StyleCheckStyle::drawComplexControl( ComplexControl control, // Draw an edit field if required if ( controls & SC_ComboBoxEditField ) { - const QComboBox * cb = (const QComboBox *) widget; - QRect re = QStyle::visualRect( + const TQComboBox * cb = (const TQComboBox *) widget; + TQRect re = TQStyle::visualRect( querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField), widget ); @@ -2287,13 +2287,13 @@ void StyleCheckStyle::drawComplexControl( ComplexControl control, if ( cb->hasFocus() && !cb->editable() ) { // Draw the contents p->fillRect( re.x(), re.y(), re.width(), re.height(), - cg.brush( QColorGroup::Highlight ) ); + cg.brush( TQColorGroup::Highlight ) ); - QRect re = QStyle::visualRect( + TQRect re = TQStyle::visualRect( subRect(SR_ComboBoxFocusRect, cb), widget); drawPrimitive( PE_FocusRect, p, re, cg, - Style_FocusAtBorder, QStyleOption(cg.highlight())); + Style_FocusAtBorder, TQStyleOption(cg.highlight())); } } break; @@ -2302,9 +2302,9 @@ void StyleCheckStyle::drawComplexControl( ComplexControl control, // TOOLBUTTON // ------------------------------------------------------------------- case CC_ToolButton: { - const QToolButton *toolbutton = (const QToolButton *) widget; + const TQToolButton *toolbutton = (const TQToolButton *) widget; - QRect button, menuarea; + TQRect button, menuarea; button = querySubControlMetrics(control, widget, SC_ToolButton, opt); menuarea = querySubControlMetrics(control, widget, SC_ToolButtonMenu, opt); @@ -2327,15 +2327,15 @@ void StyleCheckStyle::drawComplexControl( ComplexControl control, toolbutton->parentWidget()->backgroundPixmap() && !toolbutton->parentWidget()->backgroundPixmap()->isNull() ) { - QPixmap pixmap = *(toolbutton->parentWidget()->backgroundPixmap()); + TQPixmap pixmap = *(toolbutton->parentWidget()->backgroundPixmap()); p->drawTiledPixmap( r, pixmap, toolbutton->pos() ); } else if (widget->parent()) { - if (widget->parent()->inherits("QToolBar")) + if (widget->parent()->inherits("TQToolBar")) { - QToolBar* parent = (QToolBar*)widget->parent(); - QRect pr = parent->rect(); + TQToolBar* parent = (TQToolBar*)widget->parent(); + TQRect pr = parent->rect(); renderGradient( p, r, cg.button(), parent->orientation() == Qt::Vertical, @@ -2343,9 +2343,9 @@ void StyleCheckStyle::drawComplexControl( ComplexControl control, } else if (widget->parent()->inherits("QToolBarExtensionWidget")) { - QWidget* parent = (QWidget*)widget->parent(); - QToolBar* toolbar = (QToolBar*)parent->parent(); - QRect tr = toolbar->rect(); + TQWidget* parent = (TQWidget*)widget->parent(); + TQToolBar* toolbar = (TQToolBar*)parent->parent(); + TQRect tr = toolbar->rect(); if ( toolbar->orientation() == Qt::Horizontal ) { renderGradient( p, r, cg.button(), false, r.x(), r.y(), @@ -2367,7 +2367,7 @@ void StyleCheckStyle::drawComplexControl( ComplexControl control, } if (toolbutton->hasFocus() && !toolbutton->focusProxy()) { - QRect fr = toolbutton->rect(); + TQRect fr = toolbutton->rect(); fr.addCoords(3, 3, -3, -3); drawPrimitive(PE_FocusRect, p, fr, cg); } @@ -2385,10 +2385,10 @@ void StyleCheckStyle::drawComplexControl( ComplexControl control, void StyleCheckStyle::drawComplexControlMask( ComplexControl control, - QPainter *p, - const QWidget *widget, - const QRect &r, - const QStyleOption& opt ) const + TQPainter *p, + const TQWidget *widget, + const TQRect &r, + const TQStyleOption& opt ) const { switch (control) { @@ -2401,7 +2401,7 @@ void StyleCheckStyle::drawComplexControlMask( ComplexControl control, QCOORD corners[] = { x1,y1, x2,y1, x1,y2, x2,y2 }; p->fillRect( r, color1 ); p->setPen( color0 ); - p->drawPoints( QPointArray(4, corners) ); + p->drawPoints( TQPointArray(4, corners) ); break; } @@ -2411,14 +2411,14 @@ void StyleCheckStyle::drawComplexControlMask( ComplexControl control, } -QRect StyleCheckStyle::subRect(SubRect r, const QWidget *widget) const +TQRect StyleCheckStyle::subRect(SubRect r, const TQWidget *widget) const { // We want the focus rect for buttons to be adjusted from // the Qt3 defaults to be similar to Qt 2's defaults. // ------------------------------------------------------------------- if (r == SR_PushButtonFocusRect ) { - const QPushButton* button = (const QPushButton*) widget; - QRect wrect(widget->rect()); + const TQPushButton* button = (const TQPushButton*) widget; + TQRect wrect(widget->rect()); int dbw1 = 0, dbw2 = 0; if (button->isDefault() || button->autoDefault()) { @@ -2429,7 +2429,7 @@ QRect StyleCheckStyle::subRect(SubRect r, const QWidget *widget) const int dfw1 = pixelMetric(PM_DefaultFrameWidth, widget) * 2, dfw2 = dfw1 * 2; - return QRect(wrect.x() + dfw1 + dbw1 + 1, + return TQRect(wrect.x() + dfw1 + dbw1 + 1, wrect.y() + dfw1 + dbw1 + 1, wrect.width() - dfw2 - dbw2 - 1, wrect.height() - dfw2 - dbw2 - 1); @@ -2438,7 +2438,7 @@ QRect StyleCheckStyle::subRect(SubRect r, const QWidget *widget) const } -int StyleCheckStyle::pixelMetric(PixelMetric m, const QWidget *widget) const +int StyleCheckStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const { switch(m) { @@ -2470,17 +2470,17 @@ int StyleCheckStyle::pixelMetric(PixelMetric m, const QWidget *widget) const } -QSize StyleCheckStyle::sizeFromContents( ContentsType contents, - const QWidget* widget, - const QSize &contentSize, - const QStyleOption& opt ) const +TQSize StyleCheckStyle::sizeFromContents( ContentsType contents, + const TQWidget* widget, + const TQSize &contentSize, + const TQStyleOption& opt ) const { switch (contents) { // PUSHBUTTON SIZE // ------------------------------------------------------------------ case CT_PushButton: { - const QPushButton* button = (const QPushButton*) widget; + const TQPushButton* button = (const TQPushButton*) widget; int w = contentSize.width(); int h = contentSize.height(); int bm = pixelMetric( PM_ButtonMargin, widget ); @@ -2503,7 +2503,7 @@ QSize StyleCheckStyle::sizeFromContents( ContentsType contents, if ( h < 22 ) h = 22; - return QSize( w, h ); + return TQSize( w, h ); } @@ -2513,9 +2513,9 @@ QSize StyleCheckStyle::sizeFromContents( ContentsType contents, if ( ! widget || opt.isDefault() ) return contentSize; - const QPopupMenu *popup = (const QPopupMenu *) widget; + const TQPopupMenu *popup = (const TQPopupMenu *) widget; bool checkable = popup->isCheckable(); - QMenuItem *mi = opt.menuItem(); + TQMenuItem *mi = opt.menuItem(); int maxpmw = opt.maxIconWidth(); int w = contentSize.width(), h = contentSize.height(); @@ -2543,7 +2543,7 @@ QSize StyleCheckStyle::sizeFromContents( ContentsType contents, if ( mi->iconSet() ) h = QMAX( h, mi->iconSet()->pixmap( - QIconSet::Small, QIconSet::Normal).height() + + TQIconSet::Small, TQIconSet::Normal).height() + 2 * itemFrame ); } @@ -2561,7 +2561,7 @@ QSize StyleCheckStyle::sizeFromContents( ContentsType contents, w += rightBorder; - return QSize( w, h ); + return TQSize( w, h ); } @@ -2572,15 +2572,15 @@ QSize StyleCheckStyle::sizeFromContents( ContentsType contents, // Fix Qt's wacky image alignment -QPixmap StyleCheckStyle::stylePixmap(StylePixmap stylepixmap, - const QWidget* widget, - const QStyleOption& opt) const +TQPixmap StyleCheckStyle::stylePixmap(StylePixmap stylepixmap, + const TQWidget* widget, + const TQStyleOption& opt) const { switch (stylepixmap) { case SP_TitleBarMinButton: - return QPixmap((const char **)hc_minimize_xpm); + return TQPixmap((const char **)hc_minimize_xpm); case SP_TitleBarCloseButton: - return QPixmap((const char **)hc_close_xpm); + return TQPixmap((const char **)hc_close_xpm); default: break; } @@ -2589,47 +2589,47 @@ QPixmap StyleCheckStyle::stylePixmap(StylePixmap stylepixmap, } -bool StyleCheckStyle::eventFilter( QObject *object, QEvent *event ) +bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event ) { if (KStyle::eventFilter( object, event )) return true; // Handle push button hover effects. - QPushButton* button = dynamic_cast<QPushButton*>(object); + TQPushButton* button = dynamic_cast<TQPushButton*>(object); if ( button ) { - if ( (event->type() == QEvent::Enter) && + if ( (event->type() == TQEvent::Enter) && (button->isEnabled()) ) { hoverWidget = button; button->repaint( false ); } - else if ( (event->type() == QEvent::Leave) && + else if ( (event->type() == TQEvent::Leave) && (object == hoverWidget) ) { hoverWidget = 0L; button->repaint( false ); } } - if ( event->type() == QEvent::Paint && object->inherits("QLabel") ) + if ( event->type() == TQEvent::Paint && object->inherits("TQLabel") ) { - QLabel* lb = static_cast<QLabel*>(object); + TQLabel* lb = static_cast<TQLabel*>(object); if (lb->pixmap() || lb->picture() || lb->movie() || (lb->textFormat() == Qt::RichText) || - (lb->textFormat() == Qt::AutoText && QStyleSheet::mightBeRichText(lb->text())) ) + (lb->textFormat() == Qt::AutoText && TQStyleSheet::mightBeRichText(lb->text())) ) { return false; } - QPainter p(lb); + TQPainter p(lb); - QRect cr = lb->contentsRect(); + TQRect cr = lb->contentsRect(); int m = lb->indent(); if ( m < 0 && lb->frameWidth() ) // no indent, but we do have a frame m = lb->fontMetrics().width('x') / 2 - lb->margin(); if ( m > 0 ) { - int hAlign = QApplication::horizontalAlignment( lb->alignment() ); + int hAlign = TQApplication::horizontalAlignment( lb->alignment() ); if ( hAlign & AlignLeft ) cr.setLeft( cr.left() + m ); if ( hAlign & AlignRight ) @@ -2640,9 +2640,9 @@ bool StyleCheckStyle::eventFilter( QObject *object, QEvent *event ) cr.setBottom( cr.bottom() - m ); } - QValueVector<StyleGuideViolation> violations; + TQValueVector<StyleGuideViolation> violations; - if (QCString(lb->name()) == "KJanusWidgetTitleLabel" || lb->font().bold()) + if (TQCString(lb->name()) == "KJanusWidgetTitleLabel" || lb->font().bold()) { // We're a page title violations = checkTitleStyle(lb->text(), LongTitle, lb->buddy() ? HasAccels : NoAccels); @@ -2675,34 +2675,34 @@ bool StyleCheckStyle::eventFilter( QObject *object, QEvent *event ) return true; } - if ( event->type() == QEvent::Paint && object->inherits("QGroupBox") ) + if ( event->type() == TQEvent::Paint && object->inherits("TQGroupBox") ) { - QPaintEvent * pevent = static_cast<QPaintEvent*>(event); - QGroupBox* gb = static_cast<QGroupBox*>(object); + TQPaintEvent * pevent = static_cast<TQPaintEvent*>(event); + TQGroupBox* gb = static_cast<TQGroupBox*>(object); bool nestedGroupBox = false; - QString stripped_title = removedXX(stripAccelViolations(gb->title())); + TQString stripped_title = removedXX(stripAccelViolations(gb->title())); //Walk parent hierarchy to check whether any are groupboxes too.. - QObject* parent = gb; + TQObject* parent = gb; // GCC suggested parentheses around assignment used as truth value // I suggested that it could eat me. GCC won. while ( (parent = parent->parent()) ) { - if (parent->inherits("QGroupBox")) + if (parent->inherits("TQGroupBox")) { nestedGroupBox = true; break; } } - QPainter paint( gb ); + TQPainter paint( gb ); if ( stripped_title.length() ) { // draw title - QFontMetrics fm = paint.fontMetrics(); + TQFontMetrics fm = paint.fontMetrics(); int h = fm.height(); - int tw = fm.width( stripped_title, stripped_title.length() ) + 2*fm.width(QChar(' ')); + int tw = fm.width( stripped_title, stripped_title.length() ) + 2*fm.width(TQChar(' ')); int x; if ( gb->alignment() & AlignHCenter ) // center alignment x = gb->frameRect().width()/2 - tw/2; @@ -2712,14 +2712,14 @@ bool StyleCheckStyle::eventFilter( QObject *object, QEvent *event ) x = 8; else { // auto align - if( QApplication::reverseLayout() ) + if( TQApplication::reverseLayout() ) x = gb->frameRect().width() - tw - 8; else x = 8; } - QRect r( x, 0, tw, h ); + TQRect r( x, 0, tw, h ); - QValueVector<StyleGuideViolation> violations = checkTitleStyle( gb->title(), ShortTitle, HasAccels ); + TQValueVector<StyleGuideViolation> violations = checkTitleStyle( gb->title(), ShortTitle, HasAccels ); renderViolations( violations, &paint, r, AlignCenter | ShowPrefix, gb->title() ); @@ -2732,16 +2732,16 @@ bool StyleCheckStyle::eventFilter( QObject *object, QEvent *event ) if (nestedGroupBox) { paint.save(); - QPen errorPen(Qt::red, 4, QPen::DashDotDotLine); + TQPen errorPen(Qt::red, 4, TQPen::DashDotDotLine); paint.setPen(errorPen); paint.drawRect( gb->frameRect() ); paint.restore(); } else { - drawPrimitive( QStyle::PE_GroupBoxFrame, &paint, gb->frameRect(), - gb->colorGroup(), QStyle::Style_Default, - QStyleOption(gb->lineWidth(), gb->midLineWidth(), + drawPrimitive( TQStyle::PE_GroupBoxFrame, &paint, gb->frameRect(), + gb->colorGroup(), TQStyle::Style_Default, + TQStyleOption(gb->lineWidth(), gb->midLineWidth(), gb->frameShape(), gb->frameShadow()) ); } return true; //We already drew the everything @@ -2751,8 +2751,8 @@ bool StyleCheckStyle::eventFilter( QObject *object, QEvent *event ) } -void StyleCheckStyle::renderGradient( QPainter* p, const QRect& r, - QColor clr, bool, int, int, int, int) const +void StyleCheckStyle::renderGradient( TQPainter* p, const TQRect& r, + TQColor clr, bool, int, int, int, int) const { p->fillRect(r, clr); return; |