as_table.cpp

changeset 3
c1941114ca88
parent 1
d64aaa7d146f
child 12
ceb4ba3d2d00
     1.1 --- a/as_table.cpp	Fri Nov 28 14:20:00 2008 +0100
     1.2 +++ b/as_table.cpp	Fri Dec 05 23:14:02 2008 +0100
     1.3 @@ -1,12 +1,12 @@
     1.4  //
     1.5  //  OSSP asgui - Accounting system graphical user interface
     1.6 -//  Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/)
     1.7 -//  Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>
     1.8 -//  Copyright (c) 2002-2004 Michael Schloh von Bennewitz <michael@schloh.com>
     1.9 -//  Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH
    1.10 +//  Copyright (c) 2002-2008 The OSSP Project (http://www.ossp.org/)
    1.11 +//  Copyright (c) 2002-2008 Ralf S. Engelschall <rse@engelschall.com>
    1.12 +//  Copyright (c) 2002-2008 Michael Schloh von Bennewitz <michael@schloh.com>
    1.13 +//  Copyright (c) 2002-2008 Cable & Wireless Telecommunications Services GmbH
    1.14  //
    1.15  //  This file is part of OSSP asgui, an accounting system graphical user
    1.16 -//  interface which can be found at http://www.ossp.org/pkg/tool/asgui/.
    1.17 +//  interface which can be found at http://asgui.europalab.com/.
    1.18  //
    1.19  //  Permission to use, copy, modify, and distribute this software for
    1.20  //  any purpose with or without fee is hereby granted, provided that
    1.21 @@ -29,7 +29,14 @@
    1.22  //  as_table.cpp: ISO C++ implementation
    1.23  //
    1.24  
    1.25 -#include <qheader.h>
    1.26 +#define QT3_SUPPORT
    1.27 +
    1.28 +#include <q3header.h>
    1.29 +
    1.30 +//Added by qt3to4:
    1.31 +#include <QEvent>
    1.32 +#include <QMouseEvent>
    1.33 +#include <QKeyEvent>
    1.34  
    1.35  #include "as_const.h"
    1.36  #include "as_table.h"
    1.37 @@ -41,8 +48,8 @@
    1.38      if (pObject == horizontalHeader() && pEvent->type() == QEvent::MouseButtonDblClick)
    1.39          return true;
    1.40      if (pEvent->type() == QEvent::MouseButtonPress &&   // Ignore mid, right clicks
    1.41 -        ((QMouseEvent *)pEvent)->button() == QMouseEvent::RightButton ||
    1.42 -        ((QMouseEvent *)pEvent)->button() == QMouseEvent::MidButton)
    1.43 +        ((QMouseEvent *)pEvent)->button() == Qt::RightButton ||
    1.44 +        ((QMouseEvent *)pEvent)->button() == Qt::MidButton)
    1.45          return true;
    1.46      else if (pEvent->type() == QEvent::KeyPress) {
    1.47          if (((QKeyEvent *)pEvent)->key() == Qt::Key_Tab) { // Handle tab key
    1.48 @@ -119,10 +126,10 @@
    1.49              return true;                                            // Capture
    1.50  
    1.51          // Forward incompletely handled key events
    1.52 -        return QTable::eventFilter(pObject, pEvent);
    1.53 +        return Q3Table::eventFilter(pObject, pEvent);
    1.54      }
    1.55      else // Default behaviour is to pass the event onwards
    1.56 -        return QTable::eventFilter(pObject, pEvent);
    1.57 +        return Q3Table::eventFilter(pObject, pEvent);
    1.58  }
    1.59  
    1.60  // Overridden member hack to allow externally connected control
    1.61 @@ -135,7 +142,7 @@
    1.62          if (nText != this->text(nRow, nCol) && nCol != TITRAQ_IDXLINE)
    1.63              emit textEdited(nRow, nCol);
    1.64  
    1.65 -        QTable::setText(nRow, nCol, nText);
    1.66 +        Q3Table::setText(nRow, nCol, nText);
    1.67      }
    1.68  }
    1.69  
    1.70 @@ -150,7 +157,7 @@
    1.71          this->setSortdir(bAscend);
    1.72  
    1.73      this->setSortcol(nCol);
    1.74 -    QTable::sortColumn(nCol, this->getSortdir(), true);
    1.75 +    Q3Table::sortColumn(nCol, this->getSortdir(), true);
    1.76  
    1.77  //    // Announce sorting policy with multiple selections
    1.78  //    QTableSelection Testsel = this->selection(this->currentSelection());
    1.79 @@ -217,7 +224,7 @@
    1.80          }
    1.81      }
    1.82  
    1.83 -    QTable::paintCell(pPainter, nRow, nCol, Recto, bSelect, Cgroup);
    1.84 +    Q3Table::paintCell(pPainter, nRow, nCol, Recto, bSelect, Cgroup);
    1.85  };
    1.86  
    1.87  // Blah
    1.88 @@ -242,7 +249,7 @@
    1.89  // Overriden member to properly handle read only attribute after edition
    1.90  void TiTable::endEdit(int nRow, int nCol, bool bAccept, bool bReplace)
    1.91  {
    1.92 -    QTable::endEdit(nRow, nCol, bAccept, bReplace);
    1.93 +    Q3Table::endEdit(nRow, nCol, bAccept, bReplace);
    1.94  
    1.95      // Table read only attribute must be set to return to the normal
    1.96      // row highlight and selection behaviour of AS. The reason it was

mercurial