[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi/plugins/queries
From:       Lucijan Busch <lucijan () kde ! org>
Date:       2003-07-11 9:19:36
[Download RAW message or body]

CVS commit by lucijan: 

- Makefile.am created after move
- better font handling in query history


  A            Makefile.am   1.1
  M +8 -4      kexiquerydesignersqlhistory.cpp   1.11


--- koffice/kexi/plugins/queries/kexiquerydesignersqlhistory.cpp  #1.10:1.11
@@ -26,4 +26,5 @@
 #include <kdebug.h>
 #include <qregexp.h>
+#include <kglobalsettings.h>
 
 #include <koApplication.h>
@@ -256,10 +257,11 @@ HistoryEntry::highlight()
         }
 
-        QRegExp keywords("\\b(SELECT|UPDATE|INSERT|DELETE|DROP|FROM|WHERE|AND|OR|NOT|NULL)\\b");
 +        QRegExp keywords("\\b(SELECT|UPDATE|INSERT|DELETE|DROP|FROM|WHERE|AND|OR|NOT|NULL|JOIN|LEFT|RIGHT|ON)\\b");
  keywords.setCaseSensitive(false);
         text.replace(keywords, "<b>\\1</b>");
 
         kdDebug() << "HistoryEntry::highlight() text:" << text << endl;
-        m_formated = new QSimpleRichText(text, QFont("courier", 8));
+//      m_formated = new QSimpleRichText(text, QFont("courier", 8));
+        m_formated = new QSimpleRichText(text, KGlobalSettings::fixedFont());
 
 }
@@ -268,6 +270,8 @@ QRect
 HistoryEntry::geometry(int y, int width, QFontMetrics f)
 {
-        int h = 21 + f.boundingRect(2, 21, width - 2, 0, Qt::WordBreak | \
                Qt::AlignLeft | Qt::AlignVCenter, m_statement).height();
-        return QRect(0, y, width, h);
+//      int h = 21 + f.boundingRect(2, 21, width - 2, 0, Qt::WordBreak | \
Qt::AlignLeft | Qt::AlignVCenter, m_statement).height(); +//      return QRect(0, y, \
width, h); +        m_formated->setWidth(width - 2);
+        return QRect(0, y, width, m_formated->height() + 21);
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic