// @(#)root/qt:$Id$
// Author: Valeri Fine   21/01/2002

/*************************************************************************
 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
 * Copyright (C) 2002 by Valeri Fine.                                    *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TQtWidget.h"
#include "TQtClientWidget.h"
#include "TQtClientFilter.h"
#include "TQtClientGuard.h"
#include "TGQt.h"
#include "TQtLock.h"

#include <QKeySequence>
#include <QShortcut>
#include <QKeyEvent>
#include <QCloseEvent>
#include <QEvent>
#include <QDebug>

#include "TGClient.h"

////////////////////////////////////////////////////////////////////////////////
//
//  TQtClientWidget is QFrame designed to back the ROOT GUI TGWindow class objects
//
//
// TQtClientWidget  is a QFrame implementation backing  ROOT TGWindow objects
// It tries to mimic the X11 Widget behaviour, that kind the ROOT Gui relies on heavily.
//
// Since ROOT has a habit to destroy the widget many times, to protect the C++ QWidget
// against of double deleting all TQtClientWidgets are to be registered with a special
// "guard" container
//
////////////////////////////////////////////////////////////////////////////////

//______________________________________________________________________________
TQtClientWidget::TQtClientWidget(TQtClientGuard *guard, QWidget* mother, const char* name, Qt::WFlags f ):
          QFrame(mother,f)
         ,fGrabButtonMask(kAnyModifier),      fGrabEventPointerMask(kNoEventMask)
         ,fGrabEventButtonMask(kNoEventMask), fSelectEventMask(kNoEventMask), fSaveSelectInputMask(kNoEventMask) // ,fAttributeEventMask(0)
         ,fButton(kAnyButton), fPointerOwner(kFALSE)
         ,fNormalPointerCursor(0),fGrabPointerCursor(0),fGrabButtonCursor(0)
         ,fIsClosing(false)  ,fDeleteNotify(false), fGuard(guard)
         ,fCanvasWidget(0),fMyRootWindow(0),fEraseColor(0), fErasePixmap(0)
{
   setObjectName(name);
   setAttribute(Qt::WA_PaintOnScreen);
   setAttribute(Qt::WA_PaintOutsidePaintEvent);
   setAutoFillBackground(true);
 //   fEraseColor  = new QColor("red");
//   fErasePixmap = new QPixmap(palette().brush(QPalette::Window).texture());
}

//______________________________________________________________________________
TQtClientWidget::~TQtClientWidget()
{
   // fprintf(stderr, "TQtClientWidget::~TQtClientWidget dtor %p\n", this);
   // remove the event filter
   TQtClientFilter *f = gQt->QClientFilter();
   // Do we still grabbing anything ?
   if (f) f->GrabPointer(this, 0, 0, 0, kFALSE);  // ungrab pointer
   disconnect();
   if (fGuard) fGuard->DisconnectChildren(this);
   fNormalPointerCursor = 0; // to prevent the cursor shape restoring
   UnSetButtonMask(true);
   UnSetKeyMask();
   delete fEraseColor;  fEraseColor  = 0;
   delete fErasePixmap; fErasePixmap = 0;
   if (!IsClosing())
      gQt->SendDestroyEvent(this);  // notify TGClient we have been destroyed
}

//______________________________________________________________________________
void TQtClientWidget::closeEvent(QCloseEvent *ev)
{
   // This Qt QCloseEvent event handler

   // Close events are sent to widgets that the user wants to close,
   // usually by choosing "Close" from the window menu, or by clicking
   // the `X' titlebar button. They are also sent when you call QWidget::close()
   // to close a widget programmatically.

   printf("TQtClientWidget::closeEvent(QCloseEvent *ev)\n");
   QWidget::closeEvent(ev);
}
//______________________________________________________________________________
void TQtClientWidget::setEraseColor(const QColor &color)
{
   // Color to paint widget background with our PainEvent
   if (!fEraseColor)
      fEraseColor = new QColor(color);
   else
      *fEraseColor = color;
   QPalette pp = palette();
   pp.setColor(QPalette::Window, *fEraseColor);
   setPalette(pp);
//            win->setBackgroundRole(QPalette::Window);
}

//______________________________________________________________________________
void TQtClientWidget::setErasePixmap (const QPixmap &pixmap)
{
   // pixmap to paint widget background with our PainEvent
   if (!fErasePixmap)
      fErasePixmap = new QPixmap(pixmap);
   else
      *fErasePixmap = pixmap;

   QPalette pp = palette();
   pp.setBrush(QPalette::Window, QBrush(*fErasePixmap));
   setPalette(pp);
//            win->setBackgroundRole(QPalette::Window);
}

//______________________________________________________________________________
bool TQtClientWidget::IsGrabbed(Event_t &ev)
{
   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   // XGrabButton(3X11)         XLIB FUNCTIONS        XGrabButton(3X11)
   //   *    The pointer is not grabbed, and the specified button is logically
   //        pressed when the specified modifier keys are logically down,
   //        and no other buttons or modifier keys are logically down.
   //   *    The grab_window contains the pointer.
   //   *    The confine_to window (if any) is viewable.
   //   *    A passive grab on the same button/key combination does not exist
   //        on any ancestor of grab_window.
   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   bool grab = false;
   QWidget *mother = parentWidget();
//   fprintf(stderr,"\n -1- TQtClientWidget::IsGrabbed  parent = %p mask %o register = %d "
//          , parent, ButtonEventMask(),TGQt::IsRegistered(parent));
   if (     ButtonEventMask()
         && !isHidden()
         && !(   mother
               && dynamic_cast<TQtClientWidget*>(mother)  // TGQt::IsRegistered(parent)
               && ((TQtClientWidget *)mother)->IsGrabbed(ev)
             )
      )
      {

        //Test whether the current button is grabbed by this window
        bool msk = (ev.fState & fGrabButtonMask) || (fGrabButtonMask & kAnyModifier);

        if ((fButton == kAnyButton) && msk)
           grab = true;
        else
           grab = (fButton == EMouseButton(ev.fCode)) && msk;

        // Check whether this window holds the pointer coordinate
        TQtClientWidget *w = (TQtClientWidget *)TGQt::wid(ev.fWindow);
        if (grab && (w != this) ) {
           QRect absRect = geometry();
           QPoint absPos = mapToGlobal(QPoint(0,0));
           absRect.moveTopLeft(absPos);
           grab = absRect.contains(ev.fXRoot,ev.fYRoot);
        }

        if (grab)   GrabEvent(ev);
     }
   //  fprintf(stderr," this = %p grab=%d \n", this, grab);
   // TGQt::PrintEvent(ev);

   return grab;
}
//______________________________________________________________________________
TQtClientWidget *TQtClientWidget::IsKeyGrabbed(const Event_t &ev)
{
   // Check ROOT Event_t ev structure for the KeyGrab mask

   // fprintf(stderr,"Do we grab ? current window %p; event window = %p  code <%c>, grabber = %p\n",TGQt::wid(this), TGQt::rootwid(TGQt::wid(ev.fWindow)), ev.fCode,fGrabbedKey);
   TQtClientWidget *grabbed = 0;
   UInt_t modifier = ev.fState;

   if (SetKeyMask(ev.fCode,  modifier, kTestKey)) grabbed = this;
   if (grabbed && ( ev.fType == kKeyRelease)) {
      SetKeyMask(ev.fCode,  modifier, kRemove);
   }
   TQtClientWidget *wg = this;
   if (!grabbed) {
      // check parent
      do {
          wg = (TQtClientWidget *)wg->parentWidget();
      }  while ( wg && (grabbed = wg->IsKeyGrabbed(ev)) );
   }
   if (!grabbed) {
      // Check children
     const QObjectList &childList = children();
      if (!childList.isEmpty()) {
         QListIterator<QObject*> next(childList);
         while(next.hasNext() && (wg = dynamic_cast<TQtClientWidget *>(next.next ())) && !(grabbed=wg->IsKeyGrabbed(ev)) ){;}
      }
   }
   return grabbed;
}
//______________________________________________________________________________
void TQtClientWidget::GrabEvent(Event_t &ev, bool /*own*/)
{
   // replace the original Windows_t  with the grabbing id and
   // re-caclulate the mouse coordinate
   // to respect the new Windows_t id if any
   TQtClientWidget *w = (TQtClientWidget *)TGQt::wid(ev.fWindow);
   if (w != this) {
      QPoint mapped = mapFromGlobal(QPoint(ev.fXRoot,ev.fYRoot));
      // Correct the event
      ev.fX      = mapped.x();
      ev.fY      = mapped.y();
      // replace the original Windows_t  with the grabbing id
      ev.fWindow          = TGQt::wid(this);
      // fprintf(stderr,"---- TQtClientWidget::GrabEvent\n");
   }
  // TGQt::PrintEvent(ev);
}
//______________________________________________________________________________
void TQtClientWidget::SelectInput (UInt_t evmask)
{
   // Select input and chech whether qwe nat mouse tracking
   fSelectEventMask=evmask;
   assert(fSelectEventMask != (UInt_t) -1);
   setMouseTracking( fSelectEventMask & kPointerMotionMask );
}
//______________________________________________________________________________
void TQtClientWidget::SetButtonMask(UInt_t modifier,EMouseButton button)
{
   // Set the Button mask
   fGrabButtonMask  = modifier; fButton = button;
   TQtClientFilter *f = gQt->QClientFilter();
   if (f) {
      f->AppendButtonGrab(this);
      connect(this,SIGNAL(destroyed(QObject *)),f,SLOT(RemoveButtonGrab(QObject *)));
   }
}
//______________________________________________________________________________
void TQtClientWidget::UnSetButtonMask(bool dtor)
{
   // Unset the Button mask

   if (fGrabButtonMask) {
      fGrabButtonMask = 0;
      TQtClientFilter *f = gQt->QClientFilter();
      if (f) {
         if ( !dtor ) disconnect(this,SIGNAL(destroyed(QObject *)),f,SLOT(RemoveButtonGrab(QObject *)));
         f->RemoveButtonGrab(this);
      }
   }
}
//______________________________________________________________________________
Bool_t TQtClientWidget::SetKeyMask(Int_t keycode, UInt_t modifier, int insert)
{
   // Set the key button mask
   // insert   = -1 - remove
   //             0 - test
   //            +1 - insert
   Bool_t found = kTRUE;
   int ikeys = 0;
   if (keycode) {
      if (modifier & kKeyShiftMask)   ikeys |= Qt::SHIFT;
      if (modifier & kKeyLockMask)    ikeys |= Qt::META;
      if (modifier & kKeyControlMask) ikeys |= Qt::CTRL;
      if (modifier & kKeyMod1Mask)    ikeys |= Qt::ALT;
                                      ikeys |= keycode;
   }
   QKeySequence keys(ikeys);

   std::map<QKeySequence,QShortcut*>::iterator i = fGrabbedKey.find(keys);
   switch (insert) {
      case kInsert:
         if (keycode) {
            if ( i == fGrabbedKey.end()) {
               fGrabbedKey.insert(
                     std::pair<QKeySequence,QShortcut*>(keys,new QShortcut(keys,this,SLOT(Accelerate()),SLOT(Accelerate()),Qt::ApplicationShortcut))
                     );
                // qDebug() << "TQtClientWidget::SetKeyMask()" << this << " key=" << keys;
            } else {
               (*i).second->setEnabled(true);
            }
         }
         break;
      case kRemove:
         if (keycode) {
            if ( i != fGrabbedKey.end())
               (*i).second->setEnabled(false);
        } else {
            // keycode ==0 - means delete all accelerators
            // fprintf(stderr,"-%p: TQtClientWidget::SetKeyMask modifier=%d keycode \'%c\' \n", this, modifier, keycode);
            std::map<QKeySequence,QShortcut*>::iterator j = fGrabbedKey.begin();
            while (j != fGrabbedKey.end()) {
               (*j).second->setEnabled(false);
               ++j;
           }
         }
         break;
      case kTestKey:
         found = i != fGrabbedKey.end();
         break;
      default: break;
  }
  return found;
}
//______________________________________________________________________________
void TQtClientWidget::SetCanvasWidget(TQtWidget *widget)
{
   // Associate this widget with the parent ROOT gui widget
   TQtLock lock;
   if (fCanvasWidget)
      disconnect(fCanvasWidget,SIGNAL(destroyed()), this, SLOT(disconnect()));
   fCanvasWidget = widget;
   if (fCanvasWidget) {
      // may be transparent
#if QT_VERSION < 0x40000
      setWFlags(getWFlags () | Qt::WRepaintNoErase | Qt:: WResizeNoErase );
#endif /* QT_VERSION */
      connect(fCanvasWidget,SIGNAL(destroyed()),this,SLOT(Disconnect()));
   }
}
//______________________________________________________________________________
void TQtClientWidget::UnSetKeyMask(Int_t keycode, UInt_t modifier)
{
  // Unset the key button mask

  SetKeyMask(keycode, modifier, kRemove);
}
//_____slot _________________________________________________________________________
void TQtClientWidget::Accelerate()
{
  // Qt slot to respond to the "Keyboard accelerator signal"
  QShortcut *cut = (QShortcut *)sender();
  QKeySequence key = cut->key ();
  qDebug() << "TQtClientWidget::Accelerate()" << key;
  int l = key.count();
  int keycode = key[l-1];
  Qt::KeyboardModifiers state = Qt::NoModifier;

  if (keycode & Qt::SHIFT) state |=  Qt::ShiftModifier;
  if (keycode & Qt::META)  state |=  Qt::MetaModifier;
  if (keycode & Qt::CTRL)  state |=  Qt::ControlModifier;
  if (keycode & Qt::ALT)   state |=  Qt::AltModifier;

  // Create ROOT event
  QKeyEvent ac(QEvent::KeyPress,keycode & 0x01FFFFFF,state);
  // call Event filter directly
  TQtClientFilter *f = gQt->QClientFilter();
  if (f) f->AddKeyEvent(ac,this);
  QKeyEvent acRelease(QEvent::KeyRelease,keycode & 0x01FFFFFF,state);
  if (f) f->AddKeyEvent(acRelease,this);
}
//______________________________________________________________________________
void TQtClientWidget::Disconnect()
{
  // Disconnect the Canvas and ROOT gui widget before destroy.

   SetCanvasWidget(0);           }

//______________________________________________________________________________
void TQtClientWidget::paintEvent( QPaintEvent *e )
{
   QFrame::paintEvent(e);
#if ROOT_VERSION_CODE >= ROOT_VERSION(9,15,9)
   if (gClient) {
      // Find my host ROOT TGWindow
      if (!fMyRootWindow)
         fMyRootWindow = gClient->GetWindowById(TGQt::rootwid(this));
      if (fMyRootWindow) {
         gClient->NeedRedraw(fMyRootWindow,kTRUE);
      }
   }
#endif
}
 TQtClientWidget.cxx:1
 TQtClientWidget.cxx:2
 TQtClientWidget.cxx:3
 TQtClientWidget.cxx:4
 TQtClientWidget.cxx:5
 TQtClientWidget.cxx:6
 TQtClientWidget.cxx:7
 TQtClientWidget.cxx:8
 TQtClientWidget.cxx:9
 TQtClientWidget.cxx:10
 TQtClientWidget.cxx:11
 TQtClientWidget.cxx:12
 TQtClientWidget.cxx:13
 TQtClientWidget.cxx:14
 TQtClientWidget.cxx:15
 TQtClientWidget.cxx:16
 TQtClientWidget.cxx:17
 TQtClientWidget.cxx:18
 TQtClientWidget.cxx:19
 TQtClientWidget.cxx:20
 TQtClientWidget.cxx:21
 TQtClientWidget.cxx:22
 TQtClientWidget.cxx:23
 TQtClientWidget.cxx:24
 TQtClientWidget.cxx:25
 TQtClientWidget.cxx:26
 TQtClientWidget.cxx:27
 TQtClientWidget.cxx:28
 TQtClientWidget.cxx:29
 TQtClientWidget.cxx:30
 TQtClientWidget.cxx:31
 TQtClientWidget.cxx:32
 TQtClientWidget.cxx:33
 TQtClientWidget.cxx:34
 TQtClientWidget.cxx:35
 TQtClientWidget.cxx:36
 TQtClientWidget.cxx:37
 TQtClientWidget.cxx:38
 TQtClientWidget.cxx:39
 TQtClientWidget.cxx:40
 TQtClientWidget.cxx:41
 TQtClientWidget.cxx:42
 TQtClientWidget.cxx:43
 TQtClientWidget.cxx:44
 TQtClientWidget.cxx:45
 TQtClientWidget.cxx:46
 TQtClientWidget.cxx:47
 TQtClientWidget.cxx:48
 TQtClientWidget.cxx:49
 TQtClientWidget.cxx:50
 TQtClientWidget.cxx:51
 TQtClientWidget.cxx:52
 TQtClientWidget.cxx:53
 TQtClientWidget.cxx:54
 TQtClientWidget.cxx:55
 TQtClientWidget.cxx:56
 TQtClientWidget.cxx:57
 TQtClientWidget.cxx:58
 TQtClientWidget.cxx:59
 TQtClientWidget.cxx:60
 TQtClientWidget.cxx:61
 TQtClientWidget.cxx:62
 TQtClientWidget.cxx:63
 TQtClientWidget.cxx:64
 TQtClientWidget.cxx:65
 TQtClientWidget.cxx:66
 TQtClientWidget.cxx:67
 TQtClientWidget.cxx:68
 TQtClientWidget.cxx:69
 TQtClientWidget.cxx:70
 TQtClientWidget.cxx:71
 TQtClientWidget.cxx:72
 TQtClientWidget.cxx:73
 TQtClientWidget.cxx:74
 TQtClientWidget.cxx:75
 TQtClientWidget.cxx:76
 TQtClientWidget.cxx:77
 TQtClientWidget.cxx:78
 TQtClientWidget.cxx:79
 TQtClientWidget.cxx:80
 TQtClientWidget.cxx:81
 TQtClientWidget.cxx:82
 TQtClientWidget.cxx:83
 TQtClientWidget.cxx:84
 TQtClientWidget.cxx:85
 TQtClientWidget.cxx:86
 TQtClientWidget.cxx:87
 TQtClientWidget.cxx:88
 TQtClientWidget.cxx:89
 TQtClientWidget.cxx:90
 TQtClientWidget.cxx:91
 TQtClientWidget.cxx:92
 TQtClientWidget.cxx:93
 TQtClientWidget.cxx:94
 TQtClientWidget.cxx:95
 TQtClientWidget.cxx:96
 TQtClientWidget.cxx:97
 TQtClientWidget.cxx:98
 TQtClientWidget.cxx:99
 TQtClientWidget.cxx:100
 TQtClientWidget.cxx:101
 TQtClientWidget.cxx:102
 TQtClientWidget.cxx:103
 TQtClientWidget.cxx:104
 TQtClientWidget.cxx:105
 TQtClientWidget.cxx:106
 TQtClientWidget.cxx:107
 TQtClientWidget.cxx:108
 TQtClientWidget.cxx:109
 TQtClientWidget.cxx:110
 TQtClientWidget.cxx:111
 TQtClientWidget.cxx:112
 TQtClientWidget.cxx:113
 TQtClientWidget.cxx:114
 TQtClientWidget.cxx:115
 TQtClientWidget.cxx:116
 TQtClientWidget.cxx:117
 TQtClientWidget.cxx:118
 TQtClientWidget.cxx:119
 TQtClientWidget.cxx:120
 TQtClientWidget.cxx:121
 TQtClientWidget.cxx:122
 TQtClientWidget.cxx:123
 TQtClientWidget.cxx:124
 TQtClientWidget.cxx:125
 TQtClientWidget.cxx:126
 TQtClientWidget.cxx:127
 TQtClientWidget.cxx:128
 TQtClientWidget.cxx:129
 TQtClientWidget.cxx:130
 TQtClientWidget.cxx:131
 TQtClientWidget.cxx:132
 TQtClientWidget.cxx:133
 TQtClientWidget.cxx:134
 TQtClientWidget.cxx:135
 TQtClientWidget.cxx:136
 TQtClientWidget.cxx:137
 TQtClientWidget.cxx:138
 TQtClientWidget.cxx:139
 TQtClientWidget.cxx:140
 TQtClientWidget.cxx:141
 TQtClientWidget.cxx:142
 TQtClientWidget.cxx:143
 TQtClientWidget.cxx:144
 TQtClientWidget.cxx:145
 TQtClientWidget.cxx:146
 TQtClientWidget.cxx:147
 TQtClientWidget.cxx:148
 TQtClientWidget.cxx:149
 TQtClientWidget.cxx:150
 TQtClientWidget.cxx:151
 TQtClientWidget.cxx:152
 TQtClientWidget.cxx:153
 TQtClientWidget.cxx:154
 TQtClientWidget.cxx:155
 TQtClientWidget.cxx:156
 TQtClientWidget.cxx:157
 TQtClientWidget.cxx:158
 TQtClientWidget.cxx:159
 TQtClientWidget.cxx:160
 TQtClientWidget.cxx:161
 TQtClientWidget.cxx:162
 TQtClientWidget.cxx:163
 TQtClientWidget.cxx:164
 TQtClientWidget.cxx:165
 TQtClientWidget.cxx:166
 TQtClientWidget.cxx:167
 TQtClientWidget.cxx:168
 TQtClientWidget.cxx:169
 TQtClientWidget.cxx:170
 TQtClientWidget.cxx:171
 TQtClientWidget.cxx:172
 TQtClientWidget.cxx:173
 TQtClientWidget.cxx:174
 TQtClientWidget.cxx:175
 TQtClientWidget.cxx:176
 TQtClientWidget.cxx:177
 TQtClientWidget.cxx:178
 TQtClientWidget.cxx:179
 TQtClientWidget.cxx:180
 TQtClientWidget.cxx:181
 TQtClientWidget.cxx:182
 TQtClientWidget.cxx:183
 TQtClientWidget.cxx:184
 TQtClientWidget.cxx:185
 TQtClientWidget.cxx:186
 TQtClientWidget.cxx:187
 TQtClientWidget.cxx:188
 TQtClientWidget.cxx:189
 TQtClientWidget.cxx:190
 TQtClientWidget.cxx:191
 TQtClientWidget.cxx:192
 TQtClientWidget.cxx:193
 TQtClientWidget.cxx:194
 TQtClientWidget.cxx:195
 TQtClientWidget.cxx:196
 TQtClientWidget.cxx:197
 TQtClientWidget.cxx:198
 TQtClientWidget.cxx:199
 TQtClientWidget.cxx:200
 TQtClientWidget.cxx:201
 TQtClientWidget.cxx:202
 TQtClientWidget.cxx:203
 TQtClientWidget.cxx:204
 TQtClientWidget.cxx:205
 TQtClientWidget.cxx:206
 TQtClientWidget.cxx:207
 TQtClientWidget.cxx:208
 TQtClientWidget.cxx:209
 TQtClientWidget.cxx:210
 TQtClientWidget.cxx:211
 TQtClientWidget.cxx:212
 TQtClientWidget.cxx:213
 TQtClientWidget.cxx:214
 TQtClientWidget.cxx:215
 TQtClientWidget.cxx:216
 TQtClientWidget.cxx:217
 TQtClientWidget.cxx:218
 TQtClientWidget.cxx:219
 TQtClientWidget.cxx:220
 TQtClientWidget.cxx:221
 TQtClientWidget.cxx:222
 TQtClientWidget.cxx:223
 TQtClientWidget.cxx:224
 TQtClientWidget.cxx:225
 TQtClientWidget.cxx:226
 TQtClientWidget.cxx:227
 TQtClientWidget.cxx:228
 TQtClientWidget.cxx:229
 TQtClientWidget.cxx:230
 TQtClientWidget.cxx:231
 TQtClientWidget.cxx:232
 TQtClientWidget.cxx:233
 TQtClientWidget.cxx:234
 TQtClientWidget.cxx:235
 TQtClientWidget.cxx:236
 TQtClientWidget.cxx:237
 TQtClientWidget.cxx:238
 TQtClientWidget.cxx:239
 TQtClientWidget.cxx:240
 TQtClientWidget.cxx:241
 TQtClientWidget.cxx:242
 TQtClientWidget.cxx:243
 TQtClientWidget.cxx:244
 TQtClientWidget.cxx:245
 TQtClientWidget.cxx:246
 TQtClientWidget.cxx:247
 TQtClientWidget.cxx:248
 TQtClientWidget.cxx:249
 TQtClientWidget.cxx:250
 TQtClientWidget.cxx:251
 TQtClientWidget.cxx:252
 TQtClientWidget.cxx:253
 TQtClientWidget.cxx:254
 TQtClientWidget.cxx:255
 TQtClientWidget.cxx:256
 TQtClientWidget.cxx:257
 TQtClientWidget.cxx:258
 TQtClientWidget.cxx:259
 TQtClientWidget.cxx:260
 TQtClientWidget.cxx:261
 TQtClientWidget.cxx:262
 TQtClientWidget.cxx:263
 TQtClientWidget.cxx:264
 TQtClientWidget.cxx:265
 TQtClientWidget.cxx:266
 TQtClientWidget.cxx:267
 TQtClientWidget.cxx:268
 TQtClientWidget.cxx:269
 TQtClientWidget.cxx:270
 TQtClientWidget.cxx:271
 TQtClientWidget.cxx:272
 TQtClientWidget.cxx:273
 TQtClientWidget.cxx:274
 TQtClientWidget.cxx:275
 TQtClientWidget.cxx:276
 TQtClientWidget.cxx:277
 TQtClientWidget.cxx:278
 TQtClientWidget.cxx:279
 TQtClientWidget.cxx:280
 TQtClientWidget.cxx:281
 TQtClientWidget.cxx:282
 TQtClientWidget.cxx:283
 TQtClientWidget.cxx:284
 TQtClientWidget.cxx:285
 TQtClientWidget.cxx:286
 TQtClientWidget.cxx:287
 TQtClientWidget.cxx:288
 TQtClientWidget.cxx:289
 TQtClientWidget.cxx:290
 TQtClientWidget.cxx:291
 TQtClientWidget.cxx:292
 TQtClientWidget.cxx:293
 TQtClientWidget.cxx:294
 TQtClientWidget.cxx:295
 TQtClientWidget.cxx:296
 TQtClientWidget.cxx:297
 TQtClientWidget.cxx:298
 TQtClientWidget.cxx:299
 TQtClientWidget.cxx:300
 TQtClientWidget.cxx:301
 TQtClientWidget.cxx:302
 TQtClientWidget.cxx:303
 TQtClientWidget.cxx:304
 TQtClientWidget.cxx:305
 TQtClientWidget.cxx:306
 TQtClientWidget.cxx:307
 TQtClientWidget.cxx:308
 TQtClientWidget.cxx:309
 TQtClientWidget.cxx:310
 TQtClientWidget.cxx:311
 TQtClientWidget.cxx:312
 TQtClientWidget.cxx:313
 TQtClientWidget.cxx:314
 TQtClientWidget.cxx:315
 TQtClientWidget.cxx:316
 TQtClientWidget.cxx:317
 TQtClientWidget.cxx:318
 TQtClientWidget.cxx:319
 TQtClientWidget.cxx:320
 TQtClientWidget.cxx:321
 TQtClientWidget.cxx:322
 TQtClientWidget.cxx:323
 TQtClientWidget.cxx:324
 TQtClientWidget.cxx:325
 TQtClientWidget.cxx:326
 TQtClientWidget.cxx:327
 TQtClientWidget.cxx:328
 TQtClientWidget.cxx:329
 TQtClientWidget.cxx:330
 TQtClientWidget.cxx:331
 TQtClientWidget.cxx:332
 TQtClientWidget.cxx:333
 TQtClientWidget.cxx:334
 TQtClientWidget.cxx:335
 TQtClientWidget.cxx:336
 TQtClientWidget.cxx:337
 TQtClientWidget.cxx:338
 TQtClientWidget.cxx:339
 TQtClientWidget.cxx:340
 TQtClientWidget.cxx:341
 TQtClientWidget.cxx:342
 TQtClientWidget.cxx:343
 TQtClientWidget.cxx:344
 TQtClientWidget.cxx:345
 TQtClientWidget.cxx:346
 TQtClientWidget.cxx:347
 TQtClientWidget.cxx:348
 TQtClientWidget.cxx:349
 TQtClientWidget.cxx:350
 TQtClientWidget.cxx:351
 TQtClientWidget.cxx:352
 TQtClientWidget.cxx:353
 TQtClientWidget.cxx:354
 TQtClientWidget.cxx:355
 TQtClientWidget.cxx:356
 TQtClientWidget.cxx:357
 TQtClientWidget.cxx:358
 TQtClientWidget.cxx:359
 TQtClientWidget.cxx:360
 TQtClientWidget.cxx:361
 TQtClientWidget.cxx:362
 TQtClientWidget.cxx:363
 TQtClientWidget.cxx:364
 TQtClientWidget.cxx:365
 TQtClientWidget.cxx:366
 TQtClientWidget.cxx:367
 TQtClientWidget.cxx:368
 TQtClientWidget.cxx:369
 TQtClientWidget.cxx:370
 TQtClientWidget.cxx:371
 TQtClientWidget.cxx:372
 TQtClientWidget.cxx:373
 TQtClientWidget.cxx:374