OSSP CVS Repository

ossp - Check-in [2869]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2869
Date: 2002-Nov-22 20:49:19 (local)
2002-Nov-22 19:49:19 (UTC)
User:ms
Branch:
Comment: Wrote class RtTableItem to replace right-aligned table cells, missing from the stock Qt widgets.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_dataop.cpp      1.2 -> 1.3     2 inserted, 5 deleted
ossp-pkg/as/as-gui/as_tableitem.h      added-> 1.1
ossp-pkg/titraq/tidatops.cpp      1.2 -> 1.3     2 inserted, 5 deleted
ossp-pkg/titraq/titabitem.h      added-> 1.1

ossp-pkg/as/as-gui/as_dataop.cpp 1.2 -> 1.3

--- as_dataop.cpp        2002/11/22 19:42:25     1.2
+++ as_dataop.cpp        2002/11/22 19:49:19     1.3
@@ -2,7 +2,7 @@
 
 #include "titraq.h"     // Main classes
 #include "titrex.h"     // Exception classes
-
+#include "titabitem.h"  // For class RtTableItem
 
 //
 // Convenience method to load accounting data from a file
@@ -52,10 +52,7 @@
         Asline >> Account;  // Copy to the bit bucket
         Asline >> Account;  // Copy the account field
         if (Account != NULL) {
-            QRegExp Shorten("/(\\w+)$");
-            Account = QRegExp::escape(Account);
-            Account.remove(0, Shorten.search(Account));
-            m_pMaintable->setText(i, 4, Shorten.cap(Shorten.numCaptures()));
+            m_pMaintable->setItem(i, 4, new RtTableItem(m_pMaintable, QTableItem::WhenCurrent, Account));
         }
         else
             bValid = false;


ossp-pkg/as/as-gui/as_tableitem.h -> 1.1

*** /dev/null    Sat Nov 23 00:57:17 2024
--- -    Sat Nov 23 00:57:41 2024
***************
*** 0 ****
--- 1,14 ----
+ #include <qtable.h>
+ #include <qpainter.h>
+ 
+ 
+ class RtTableItem : public QTableItem
+ {
+ public:
+     RtTableItem(QTable *pTable, EditType eType, const QString &Text) : QTableItem(pTable, eType, Text) {m_nOwnalign = AlignRight;};
+     void setAlignment(int nAlign) {m_nOwnalign = nAlign;};
+     int alignment() const {return m_nOwnalign;};
+ 
+ private:
+     int m_nOwnalign;
+ };



CVSTrac 2.0.1