1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
|
/**********************************************************************
** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
**
** This file is part of Qt Designer.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "globaldefs.h"
#include "hierarchyview.h"
#include "formwindow.h"
#include "mainwindow.h"
#include "command.h"
#include "widgetfactory.h"
#include "widgetdatabase.h"
#include "pixmapchooser.h"
#include "propertyeditor.h"
#include "listeditor.h"
#include <tqpalette.h>
#include <tqobjectlist.h>
#include <tqheader.h>
#include <tqpopupmenu.h>
#include <tqtabwidget.h>
#include <tqwizard.h>
#include <tqwidgetstack.h>
#include <tqtabbar.h>
#include <tqfeatures.h>
#include <tqapplication.h>
#include <tqtimer.h>
#include <tqworkspace.h>
#include <tqaccel.h>
#include <klocale.h>
#include <stdlib.h>
static const char * const folder_xpm[]={
"16 16 6 1",
". c None",
"b c #ffff00",
"d c #000000",
"* c #999999",
"a c #cccccc",
"c c #ffffff",
"................",
"................",
"..*****.........",
".*ababa*........",
"*abababa******..",
"*cccccccccccc*d.",
"*cbababababab*d.",
"*cabababababa*d.",
"*cbababababab*d.",
"*cabababababa*d.",
"*cbababababab*d.",
"*cabababababa*d.",
"*cbababababab*d.",
"**************d.",
".dddddddddddddd.",
"................"};
TQListViewItem *newItem = 0;
HierarchyItem::HierarchyItem( Type type, TQListViewItem *parent,
const TQString &txt1, const TQString &txt2, const TQString &txt3 )
: TQListViewItem( parent, txt1, txt2, txt3 ), typ( type )
{
}
HierarchyItem::HierarchyItem( Type type, TQListView *parent,
const TQString &txt1, const TQString &txt2, const TQString &txt3 )
: TQListViewItem( parent, txt1, txt2, txt3 ), typ( type )
{
}
void HierarchyItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, int width, int align )
{
TQColorGroup g( cg );
g.setColor( TQColorGroup::Base, backgroundColor() );
g.setColor( TQColorGroup::Foreground, Qt::black );
g.setColor( TQColorGroup::Text, Qt::black );
TQString txt = text( 0 );
if ( rtti() == Slot &&
( txt == "init()" || txt == "destroy()" ) ) {
listView()->setUpdatesEnabled( false );
if ( txt == "init()" )
setText( 0, txt + " " + i18n( "(Constructor)" ) );
else
setText( 0, txt + " " + i18n( "(Destructor)" ) );
TQListViewItem::paintCell( p, g, column, width, align );
setText( 0, txt );
listView()->setUpdatesEnabled( true );
} else {
TQListViewItem::paintCell( p, g, column, width, align );
}
p->save();
p->setPen( TQPen( cg.dark(), 1 ) );
if ( column == 0 )
p->drawLine( 0, 0, 0, height() - 1 );
if ( listView()->firstChild() != this ) {
if ( nextSibling() != itemBelow() && itemBelow()->depth() < depth() ) {
int d = depth() - itemBelow()->depth();
p->drawLine( -listView()->treeStepSize() * d, height() - 1, 0, height() - 1 );
}
}
p->drawLine( 0, height() - 1, width, height() - 1 );
p->drawLine( width - 1, 0, width - 1, height() );
p->restore();
}
TQColor HierarchyItem::backgroundColor()
{
updateBackColor();
return backColor;
}
void HierarchyItem::updateBackColor()
{
if ( listView()->firstChild() == this ) {
backColor = *backColor1;
return;
}
TQListViewItemIterator it( this );
--it;
if ( it.current() ) {
if ( ( ( HierarchyItem*)it.current() )->backColor == *backColor1 )
backColor = *backColor2;
else
backColor = *backColor1;
} else {
backColor = *backColor1;
}
}
void HierarchyItem::setWidget( TQWidget *w )
{
wid = w;
}
TQWidget *HierarchyItem::widget() const
{
return wid;
}
void HierarchyItem::okRename( int col )
{
if ( newItem == this )
newItem = 0;
TQListViewItem::okRename( col );
}
void HierarchyItem::cancelRename( int col )
{
if ( newItem == this ) {
newItem = 0;
TQListViewItem::cancelRename( col );
delete this;
return;
}
TQListViewItem::cancelRename( col );
}
HierarchyList::HierarchyList( TQWidget *parent, FormWindow *fw, bool doConnects )
: TQListView( parent ), formWindow( fw )
{
init_colors();
setDefaultRenameAction( Accept );
header()->setMovingEnabled( false );
header()->setStretchEnabled( true );
normalMenu = 0;
tabWidgetMenu = 0;
addColumn( i18n("Name" ) );
addColumn( i18n("Class" ) );
TQPalette p( palette() );
p.setColor( TQColorGroup::Base, TQColor( *backColor2 ) );
(void)*selectedBack; // hack
setPalette( p );
disconnect( header(), TQT_SIGNAL( sectionClicked( int ) ),
this, TQT_SLOT( changeSortColumn( int ) ) );
setSorting( -1 );
setHScrollBarMode( AlwaysOff );
setVScrollBarMode( AlwaysOn );
if ( doConnects ) {
connect( this, TQT_SIGNAL( clicked( TQListViewItem * ) ),
this, TQT_SLOT( objectClicked( TQListViewItem * ) ) );
connect( this, TQT_SIGNAL( returnPressed( TQListViewItem * ) ),
this, TQT_SLOT( objectClicked( TQListViewItem * ) ) );
connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint&, int ) ),
this, TQT_SLOT( showRMBMenu( TQListViewItem *, const TQPoint & ) ) );
}
deselect = true;
setColumnWidthMode( 1, Manual );
}
void HierarchyList::keyPressEvent( TQKeyEvent *e )
{
if ( e->key() == Key_Shift || e->key() == Key_Control )
deselect = false;
else
deselect = true;
TQListView::keyPressEvent( e );
}
void HierarchyList::keyReleaseEvent( TQKeyEvent *e )
{
deselect = true;
TQListView::keyReleaseEvent( e );
}
void HierarchyList::viewportMousePressEvent( TQMouseEvent *e )
{
if ( e->state() & ShiftButton || e->state() & ControlButton )
deselect = false;
else
deselect = true;
TQListView::viewportMousePressEvent( e );
}
void HierarchyList::viewportMouseReleaseEvent( TQMouseEvent *e )
{
TQListView::viewportMouseReleaseEvent( e );
}
void HierarchyList::objectClicked( TQListViewItem *i )
{
if ( !i )
return;
TQWidget *w = findWidget( i );
if ( !w )
return;
if ( formWindow == w ) {
if ( deselect )
formWindow->clearSelection( false );
formWindow->emitShowProperties( formWindow );
return;
}
if ( !formWindow->widgets()->find( w ) ) {
if ( w->parent() && w->parent()->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) &&
w->parent()->parent() &&
( w->parent()->parent()->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ||
w->parent()->parent()->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) ) {
if ( w->parent()->parent()->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
( (TQTabWidget*)w->parent()->parent() )->showPage( w );
else
( (QDesignerWizard*)w->parent()->parent() )->setCurrentPage( ( (QDesignerWizard*)w->parent()->parent() )->pageNum( w ) );
w = (TQWidget*)w->parent()->parent();
formWindow->emitUpdateProperties( formWindow->currentWidget() );
} else {
return;
}
}
if ( deselect )
formWindow->clearSelection( false );
if ( w->isVisibleTo( formWindow ) )
formWindow->selectWidget( w, true );
}
TQWidget *HierarchyList::findWidget( TQListViewItem *i )
{
return ( (HierarchyItem*)i )->widget();
}
TQListViewItem *HierarchyList::findItem( TQWidget *w )
{
TQListViewItemIterator it( this );
while ( it.current() ) {
if ( ( (HierarchyItem*)it.current() )->widget() == w )
return it.current();
++it;
}
return 0;
}
TQWidget *HierarchyList::current() const
{
if ( currentItem() )
return ( (HierarchyItem*)currentItem() )->widget();
return 0;
}
void HierarchyList::changeNameOf( TQWidget *w, const TQString &name )
{
TQListViewItem *item = findItem( w );
if ( !item )
return;
item->setText( 0, name );
}
void HierarchyList::changeDatabaseOf( TQWidget *w, const TQString & info )
{
#ifndef QT_NO_SQL
if ( !formWindow->isDatabaseAware() )
return;
TQListViewItem *item = findItem( w );
if ( !item )
return;
item->setText( 2, info );
#else
Q_UNUSED(w);
Q_UNUSED(info);
#endif
}
void HierarchyList::setup()
{
if ( !formWindow )
return;
clear();
TQWidget *w = formWindow->mainContainer();
#ifndef QT_NO_SQL
if ( formWindow->isDatabaseAware() ) {
if ( columns() == 2 ) {
addColumn( i18n("Database" ) );
header()->resizeSection( 0, 1 );
header()->resizeSection( 1, 1 );
header()->resizeSection( 2, 1 );
header()->adjustHeaderSize();
}
} else {
if ( columns() == 3 ) {
removeColumn( 2 );
}
}
#endif
if ( w )
insertObject( w, 0 );
}
void HierarchyList::setOpen( TQListViewItem *i, bool b )
{
TQListView::setOpen( i, b );
}
void HierarchyList::insertObject( TQObject *o, TQListViewItem *parent )
{
bool fakeMainWindow = false;
if ( o && o->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) {
TQObject *cw = ( (TQMainWindow*)o )->centralWidget();
if ( cw ) {
o = cw;
fakeMainWindow = true;
}
}
TQListViewItem *item = 0;
TQString className = WidgetFactory::classNameOf( o );
if ( o->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) ) {
switch ( WidgetFactory::layoutType( (TQWidget*)o ) ) {
case WidgetFactory::HBox:
className = "HBox";
break;
case WidgetFactory::VBox:
className = "VBox";
break;
case WidgetFactory::Grid:
className = "Grid";
break;
default:
break;
}
}
TQString dbInfo;
#ifndef QT_NO_SQL
dbInfo = MetaDataBase::fakeProperty( o, "database" ).toStringList().join(".");
#endif
TQString name = o->name();
if ( o->parent() && o->parent()->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) &&
o->parent()->parent() ) {
if ( o->parent()->parent()->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
name = ( (TQTabWidget*)o->parent()->parent() )->tabLabel( (TQWidget*)o );
else if ( o->parent()->parent()->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
name = ( (TQWizard*)o->parent()->parent() )->title( (TQWidget*)o );
}
TQToolBox *tb;
if ( o->parent() && o->parent()->parent() &&
(tb = ::qt_cast<TQToolBox*>(o->parent()->parent()->parent())) )
name = tb->itemLabel( tb->indexOf((TQWidget*)o) );
if ( fakeMainWindow ) {
name = o->parent()->name();
className = TQMAINWINDOW_OBJECT_NAME_STRING;
}
if ( !parent )
item = new HierarchyItem( HierarchyItem::Widget, this, name, className, dbInfo );
else
item = new HierarchyItem( HierarchyItem::Widget, parent, name, className, dbInfo );
if ( !parent )
item->setPixmap( 0, PixmapChooser::loadPixmap( "form.xpm", PixmapChooser::Mini ) );
else if ( o->inherits( "QLayoutWidget") )
item->setPixmap( 0, PixmapChooser::loadPixmap( "layout.xpm", PixmapChooser::Small ) );
else
item->setPixmap( 0, WidgetDatabase::iconSet( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( o ) ) ).
pixmap( TQIconSet::Small, TQIconSet::Normal ) );
( (HierarchyItem*)item )->setWidget( (TQWidget*)o );
const TQObjectList *l = o->children();
if ( !l )
return;
TQObjectListIt it( *l );
it.toLast();
for ( ; it.current(); --it ) {
if ( !it.current()->isWidgetType() || ( (TQWidget*)it.current() )->isHidden() )
continue;
if ( !formWindow->widgets()->find( (TQWidget*)it.current() ) ) {
if ( it.current()->parent() &&
( it.current()->parent()->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ||
it.current()->parent()->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) &&
it.current()->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) {
TQObject *obj = it.current();
TQObjectList *l2 = obj->queryList( TQWIDGET_OBJECT_NAME_STRING, 0, true, false );
QDesignerTabWidget *tw = 0;
QDesignerWizard *dw = 0;
if ( it.current()->parent()->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
tw = (QDesignerTabWidget*)it.current()->parent();
if ( it.current()->parent()->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
dw = (QDesignerWizard*)it.current()->parent();
TQWidgetStack *stack = (TQWidgetStack*)obj;
for ( obj = l2->last(); obj; obj = l2->prev() ) {
if ( qstrcmp( obj->className(), "QWidgetStackPrivate::Invisible" ) == 0 ||
( tw && !tw->tabBar()->tab( stack->id( (TQWidget*)obj ) ) ) ||
( dw && dw->isPageRemoved( (TQWidget*)obj ) ) )
continue;
insertObject( obj, item );
}
delete l2;
} else if ( ::qt_cast<TQToolBox*>(it.current()->parent()) ) {
if ( !::qt_cast<TQScrollView*>(it.current()) )
continue;
TQToolBox *tb = (TQToolBox*)it.current()->parent();
for ( int i = tb->count() - 1; i >= 0; --i )
insertObject( tb->item( i ), item );
}
continue;
}
insertObject( it.current(), item );
}
if ( item->firstChild() )
item->setOpen( true );
}
void HierarchyList::setCurrent( TQWidget *w )
{
TQListViewItemIterator it( this );
while ( it.current() ) {
if ( ( (HierarchyItem*)it.current() )->widget() == w ) {
blockSignals( true );
setCurrentItem( it.current() );
ensureItemVisible( it.current() );
blockSignals( false );
return;
}
++it;
}
}
void HierarchyList::showRMBMenu( TQListViewItem *i, const TQPoint & p )
{
if ( !i )
return;
TQWidget *w = findWidget( i );
if ( !w )
return;
if ( w != formWindow &&
!formWindow->widgets()->find( w ) )
return;
if ( w->isVisibleTo( formWindow ) ) {
if ( !w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) && !w->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
if ( !normalMenu )
normalMenu = formWindow->mainWindow()->setupNormalHierarchyMenu( this );
normalMenu->popup( p );
} else {
if ( !tabWidgetMenu )
tabWidgetMenu =
formWindow->mainWindow()->setupTabWidgetHierarchyMenu( this, TQT_SLOT( addTabPage() ),
TQT_SLOT( removeTabPage() ) );
tabWidgetMenu->popup( p );
}
}
}
void HierarchyList::addTabPage()
{
TQWidget *w = current();
if ( !w )
return;
if ( w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) {
TQTabWidget *tw = (TQTabWidget*)w;
AddTabPageCommand *cmd = new AddTabPageCommand( i18n("Add Page to %1" ).arg( tw->name() ), formWindow,
tw, "Tab" );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
} else if ( w->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
TQWizard *wiz = (TQWizard*)formWindow->mainContainer();
AddWizardPageCommand *cmd = new AddWizardPageCommand( i18n("Add Page to %1" ).arg( wiz->name() ), formWindow,
wiz, "Page" );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
}
}
void HierarchyList::removeTabPage()
{
TQWidget *w = current();
if ( !w )
return;
if ( w->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) {
TQTabWidget *tw = (TQTabWidget*)w;
if ( tw->currentPage() ) {
QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw;
DeleteTabPageCommand *cmd = new DeleteTabPageCommand( i18n("Delete Page %1 of %2" ).
arg( dtw->pageTitle() ).arg( tw->name() ),
formWindow, tw, tw->currentPage() );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
}
} else if ( w->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
TQWizard *wiz = (TQWizard*)formWindow->mainContainer();
if ( wiz->currentPage() ) {
QDesignerWizard *dw = (QDesignerWizard*)wiz;
DeleteWizardPageCommand *cmd = new DeleteWizardPageCommand( i18n("Delete Page %1 of %2" ).
arg( dw->pageTitle() ).arg( wiz->name() ),
formWindow, wiz,
wiz->indexOf( wiz->currentPage() ), true );
formWindow->commandHistory()->addCommand( cmd );
cmd->execute();
}
}
}
// ------------------------------------------------------------
// ------------------------------------------------------------
static HierarchyItem::Type getChildType( int type )
{
switch ( (HierarchyItem::Type)type ) {
case HierarchyItem::Widget:
case HierarchyItem::SlotParent:
qWarning( "getChildType: Inserting childs dynamically to Widget or SlotParent is not allwowed!" );
return (HierarchyItem::Type)type;
case HierarchyItem::Public:
case HierarchyItem::Protected:
case HierarchyItem::Private:
case HierarchyItem::Slot:
return HierarchyItem::Slot;
case HierarchyItem::DefinitionParent:
case HierarchyItem::Definition:
return HierarchyItem::Definition;
case HierarchyItem::Event:
case HierarchyItem::EventFunction:
return HierarchyItem::Event;
}
return (HierarchyItem::Type)type;
}
void HierarchyList::insertEntry( TQListViewItem *i, const TQPixmap &pix, const TQString &s )
{
HierarchyItem *item = new HierarchyItem( getChildType( i->rtti() ), i, s,
TQString::null, TQString::null );
if ( !pix.isNull() )
item->setPixmap( 0, pix );
item->setRenameEnabled( 0, true );
setCurrentItem( item );
ensureItemVisible( item );
qApp->processEvents();
newItem = item;
item->startRename( 0 );
}
HierarchyView::HierarchyView( TQWidget *parent )
: TQTabWidget( parent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title |
WStyle_Tool |WStyle_MinMax | WStyle_SysMenu )
{
formwindow = 0;
setIcon( PixmapChooser::loadPixmap( "logo" ) );
listview = new HierarchyList( this, formWindow() );
addTab( listview, i18n("Widgets" ) );
}
HierarchyView::~HierarchyView()
{
}
void HierarchyView::clear()
{
listview->clear();
}
void HierarchyView::setFormWindow( FormWindow *fw, TQWidget *w )
{
if (fw == 0 || w == 0)
{
listview->clear();
listview->setFormWindow(fw);
formwindow = 0;
}
if (fw == formwindow)
{
listview->setCurrent(w);
if (MainWindow::self->qWorkspace()->activeWindow() == fw)
showPage(listview);
return;
}
formwindow = fw;
listview->setFormWindow(fw);
listview->setup();
listview->setCurrent(w);
if (MainWindow::self->qWorkspace()->activeWindow() == fw)
showPage(listview);
}
FormWindow *HierarchyView::formWindow() const
{
return formwindow;
}
void HierarchyView::closeEvent( TQCloseEvent *e )
{
emit hidden();
e->accept();
}
void HierarchyView::widgetInserted( TQWidget * )
{
listview->setup();
}
void HierarchyView::widgetRemoved( TQWidget * )
{
listview->setup();
}
void HierarchyView::widgetsInserted( const TQWidgetList & )
{
listview->setup();
}
void HierarchyView::widgetsRemoved( const TQWidgetList & )
{
listview->setup();
}
void HierarchyView::namePropertyChanged( TQWidget *w, const TQVariant & )
{
TQWidget *w2 = w;
if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
w2 = ( (TQMainWindow*)w )->centralWidget();
listview->changeNameOf( w2, w->name() );
}
void HierarchyView::databasePropertyChanged( TQWidget *w, const TQStringList& info )
{
#ifndef QT_NO_SQL
TQString i = info.join( "." );
listview->changeDatabaseOf( w, i );
#else
Q_UNUSED(w);
Q_UNUSED(info);
#endif
}
void HierarchyView::tabsChanged( TQTabWidget * )
{
listview->setup();
}
void HierarchyView::tabsChanged( TQToolBox * )
{
listview->setup();
}
void HierarchyView::pagesChanged( TQWizard * )
{
listview->setup();
}
void HierarchyView::rebuild()
{
listview->setup();
}
void HierarchyView::closed( FormWindow *fw )
{
if ( fw == formwindow )
listview->clear();
}
#include "hierarchyview.moc"
|