VirtualBox

Changeset 10332

Show
Ignore:
Timestamp:
07/07/08 16:33:02 (5 months ago)
Author:
vboxsync
Message:

FE/Qt4: some simplification

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSettingsDialogSpecific.cpp

    r10212 r10332  
    209209    VBoxSettingsPage *page = 0; 
    210210 
    211     page = attachPage ((VBoxSettingsPage*) new VBoxVMSettingsGeneral()); 
     211    page = attachPage (new VBoxVMSettingsGeneral()); 
    212212    connect (page, SIGNAL (tableChanged()), this, SLOT (resetFirstRunFlag())); 
    213213 
    214     page = attachPage ((VBoxSettingsPage*) new VBoxVMSettingsHD()); 
     214    page = attachPage (new VBoxVMSettingsHD()); 
    215215    connect (page, SIGNAL (hdChanged()), this, SLOT (resetFirstRunFlag())); 
    216216 
    217     page = attachPage ((VBoxSettingsPage*) new VBoxVMSettingsCD()); 
     217    page = attachPage (new VBoxVMSettingsCD()); 
    218218    connect (page, SIGNAL (cdChanged()), this, SLOT (resetFirstRunFlag())); 
    219219 
    220     page = attachPage ((VBoxSettingsPage*) new VBoxVMSettingsFD()); 
     220    page = attachPage (new VBoxVMSettingsFD()); 
    221221    connect (page, SIGNAL (fdChanged()), this, SLOT (resetFirstRunFlag())); 
    222222 
    223     attachPage ((VBoxSettingsPage*) new VBoxVMSettingsAudio()); 
    224  
    225     attachPage ((VBoxSettingsPage*) new VBoxVMSettingsNetworkPage()); 
    226  
    227     attachPage ((VBoxSettingsPage*) new VBoxVMSettingsSerialPage()); 
    228  
    229     attachPage ((VBoxSettingsPage*) new VBoxVMSettingsParallelPage()); 
    230  
    231     attachPage ((VBoxSettingsPage*) new VBoxVMSettingsUSB (VBoxVMSettingsUSB::MachineType)); 
    232  
    233     attachPage ((VBoxSettingsPage*) new VBoxVMSettingsSF (MachineType)); 
    234  
    235     attachPage ((VBoxSettingsPage*) new VBoxVMSettingsVRDP()); 
     223    attachPage (new VBoxVMSettingsAudio()); 
     224 
     225    attachPage (new VBoxVMSettingsNetworkPage()); 
     226 
     227    attachPage (new VBoxVMSettingsSerialPage()); 
     228 
     229    attachPage (new VBoxVMSettingsParallelPage()); 
     230 
     231    attachPage (new VBoxVMSettingsUSB (VBoxVMSettingsUSB::MachineType)); 
     232 
     233    attachPage (new VBoxVMSettingsSF (MachineType)); 
     234 
     235    attachPage (new VBoxVMSettingsVRDP()); 
    236236 
    237237    /* Setup Settings Dialog */ 
     
    239239    { 
    240240        /* Search for a list view item corresponding to the category */ 
    241         QTreeWidgetItem *item = findItem (mTwSelector, aCategory, treeWidget_Link); 
    242         if (item) 
     241        if (QTreeWidgetItem *item = findItem (mTwSelector, aCategory, treeWidget_Link)) 
    243242        { 
    244243            mTwSelector->setCurrentItem (item); 
    245  
    246244            /* Search for a widget with the given name */ 
    247245            if (!aControl.isNull()) 
    248246            { 
    249                 QObject *obj = mStack->currentWidget()->findChild<QWidget*> (aControl); 
    250                 if (obj && obj->isWidgetType()) 
     247                if (QWidget *w = mStack->currentWidget()->findChild<QWidget*> (aControl)) 
    251248                { 
    252                     QWidget *w = static_cast<QWidget*> (obj); 
    253249                    QList<QWidget*> parents; 
    254250                    QWidget *p = w; 
    255251                    while ((p = p->parentWidget()) != NULL) 
    256252                    { 
    257                         if (p->inherits ("QTabWidget")) 
     253                        if (QTabWidget *tb = qobject_cast<QTabWidget*> (p)) 
    258254                        { 
    259255                            /* The tab contents widget is two steps down 
     
    263259                                c = parents [parents.count() - 2]; 
    264260                            if (c) 
    265                                 static_cast<QTabWidget*> (p)->setCurrentWidget (c); 
     261                                tb->setCurrentWidget (c); 
    266262                        } 
    267263                        parents.append (p); 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy