VirtualBox

Changeset 54055 in vbox


Ignore:
Timestamp:
Jan 30, 2015 7:07:32 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: 7679: Migration from Qt 4.7.1 to Qt 4.8.6: Make sure native cocoa widgets are visible.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.cpp

    r52722 r54055  
    7373
    7474        /* Next/Previous buttons: */
    75         m_pNextPrevButtons = new UIRoundRectSegmentedButton(2, this);
     75        m_pNextPrevButtons = new UIRoundRectSegmentedButton(this, 2);
    7676        m_pNextPrevButtons->setEnabled(0, false);
    7777        m_pNextPrevButtons->setEnabled(1, false);
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaSpecialControls.h

    r52727 r54055  
    2323/* Qt includes */
    2424#include <QWidget>
    25 
    26 /* Qt forward includes */
    27 class QMacCocoaViewContainer;
     25#include <QMacCocoaViewContainer>
    2826
    2927/* Add typedefs for Cocoa types */
     
    3230ADD_COCOA_NATIVE_REF(NSSearchField);
    3331
    34 class UICocoaWrapper: public QWidget
    35 {
    36 public:
    37     UICocoaWrapper(QWidget *pParent = 0);
    38 
    39 protected:
    40     virtual void resizeEvent(QResizeEvent *pEvent);
    41 
    42     QMacCocoaViewContainer *m_pContainer;
    43 };
    44 
    45 class UICocoaButton: public UICocoaWrapper
     32class UICocoaButton: public QMacCocoaViewContainer
    4633{
    4734    Q_OBJECT
     
    5542    };
    5643
    57     UICocoaButton(CocoaButtonType aType, QWidget *pParent = 0);
     44    UICocoaButton(QWidget *pParent, CocoaButtonType type);
    5845    ~UICocoaButton();
    5946
     
    6956
    7057private:
    71     /* Private member vars */
    72     NativeNSButtonRef m_pNativeRef;
     58    NativeNSButtonRef nativeRef() const { return static_cast<NativeNSButtonRef>(cocoaView()); }
    7359};
    7460
    75 class UICocoaSegmentedButton: public UICocoaWrapper
     61class UICocoaSegmentedButton: public QMacCocoaViewContainer
    7662{
    7763    Q_OBJECT
     
    8470    };
    8571
    86     UICocoaSegmentedButton(int count, CocoaSegmentType type = RoundRectSegment, QWidget *pParent = 0);
     72    UICocoaSegmentedButton(QWidget *pParent, int count, CocoaSegmentType type = RoundRectSegment);
    8773    ~UICocoaSegmentedButton();
    8874
     
    10187
    10288private:
    103     /* Private member vars */
    104     NativeNSSegmentedControlRef m_pNativeRef;
     89    NativeNSSegmentedControlRef nativeRef() const { return static_cast<NativeNSSegmentedControlRef>(cocoaView()); }
    10590};
    10691
    107 class UICocoaSearchField: public UICocoaWrapper
     92class UICocoaSearchField: public QMacCocoaViewContainer
    10893{
    10994    Q_OBJECT
    11095
    11196public:
    112     UICocoaSearchField(QWidget* pParent = 0);
     97    UICocoaSearchField(QWidget* pParent);
    11398    ~UICocoaSearchField();
    11499
     
    129114
    130115private:
    131     /* Private member vars */
    132     NativeNSSearchFieldRef m_pNativeRef;
     116    NativeNSSearchFieldRef nativeRef() const { return static_cast<NativeNSSearchFieldRef>(cocoaView()); }
    133117};
    134118
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaSpecialControls.mm

    r52727 r54055  
    234234 * Public classes
    235235 */
    236 UICocoaWrapper::UICocoaWrapper(QWidget *pParent /* = 0 */)
    237     : QWidget(pParent)
    238     , m_pContainer(0)
    239 {
    240 }
    241 
    242 void UICocoaWrapper::resizeEvent(QResizeEvent *pEvent)
    243 {
    244     if (m_pContainer)
    245         m_pContainer->resize(pEvent->size());
    246     QWidget::resizeEvent(pEvent);
    247 }
    248 
    249 UICocoaButton::UICocoaButton(CocoaButtonType aType, QWidget *pParent /* = 0 */)
    250   : UICocoaWrapper(pParent)
    251 {
     236UICocoaButton::UICocoaButton(QWidget *pParent, CocoaButtonType type)
     237    : QMacCocoaViewContainer(0, pParent)
     238{
     239    /* Prepare auto-release pool: */
     240    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     241
     242    /* Prepare native button reference: */
     243    NativeNSButtonRef pNativeRef;
    252244    NSRect initFrame;
    253245
    254     switch (aType)
     246    /* Configure button: */
     247    switch (type)
    255248    {
    256249        case HelpButton:
    257250        {
    258             m_pNativeRef = [[NSButton alloc] init];
    259             [m_pNativeRef setTitle: @""];
    260             [m_pNativeRef setBezelStyle: NSHelpButtonBezelStyle];
    261             [m_pNativeRef setBordered: YES];
    262             [m_pNativeRef setAlignment: NSCenterTextAlignment];
    263             [m_pNativeRef sizeToFit];
    264             initFrame = [m_pNativeRef frame];
     251            pNativeRef = [[NSButton alloc] init];
     252            [pNativeRef setTitle: @""];
     253            [pNativeRef setBezelStyle: NSHelpButtonBezelStyle];
     254            [pNativeRef setBordered: YES];
     255            [pNativeRef setAlignment: NSCenterTextAlignment];
     256            [pNativeRef sizeToFit];
     257            initFrame = [pNativeRef frame];
    265258            initFrame.size.width += 12; /* Margin */
    266             [m_pNativeRef setFrame:initFrame];
     259            [pNativeRef setFrame:initFrame];
    267260            break;
    268261        };
    269262        case CancelButton:
    270263        {
    271             m_pNativeRef = [[NSButton alloc] initWithFrame: NSMakeRect(0, 0, 13, 13)];
    272             [m_pNativeRef setTitle: @""];
    273             [m_pNativeRef setBezelStyle:NSShadowlessSquareBezelStyle];
    274             [m_pNativeRef setButtonType:NSMomentaryChangeButton];
    275             [m_pNativeRef setImage: [NSImage imageNamed: NSImageNameStopProgressFreestandingTemplate]];
    276             [m_pNativeRef setBordered: NO];
    277             [[m_pNativeRef cell] setImageScaling: NSImageScaleProportionallyDown];
    278             initFrame = [m_pNativeRef frame];
     264            pNativeRef = [[NSButton alloc] initWithFrame: NSMakeRect(0, 0, 13, 13)];
     265            [pNativeRef setTitle: @""];
     266            [pNativeRef setBezelStyle:NSShadowlessSquareBezelStyle];
     267            [pNativeRef setButtonType:NSMomentaryChangeButton];
     268            [pNativeRef setImage: [NSImage imageNamed: NSImageNameStopProgressFreestandingTemplate]];
     269            [pNativeRef setBordered: NO];
     270            [[pNativeRef cell] setImageScaling: NSImageScaleProportionallyDown];
     271            initFrame = [pNativeRef frame];
    279272            break;
    280273        }
    281274        case ResetButton:
    282275        {
    283             m_pNativeRef = [[NSButton alloc] initWithFrame: NSMakeRect(0, 0, 13, 13)];
    284             [m_pNativeRef setTitle: @""];
    285             [m_pNativeRef setBezelStyle:NSShadowlessSquareBezelStyle];
    286             [m_pNativeRef setButtonType:NSMomentaryChangeButton];
    287             [m_pNativeRef setImage: [NSImage imageNamed: NSImageNameRefreshFreestandingTemplate]];
    288             [m_pNativeRef setBordered: NO];
    289             [[m_pNativeRef cell] setImageScaling: NSImageScaleProportionallyDown];
    290             initFrame = [m_pNativeRef frame];
     276            pNativeRef = [[NSButton alloc] initWithFrame: NSMakeRect(0, 0, 13, 13)];
     277            [pNativeRef setTitle: @""];
     278            [pNativeRef setBezelStyle:NSShadowlessSquareBezelStyle];
     279            [pNativeRef setButtonType:NSMomentaryChangeButton];
     280            [pNativeRef setImage: [NSImage imageNamed: NSImageNameRefreshFreestandingTemplate]];
     281            [pNativeRef setBordered: NO];
     282            [[pNativeRef cell] setImageScaling: NSImageScaleProportionallyDown];
     283            initFrame = [pNativeRef frame];
    291284            break;
    292285        }
    293286    }
    294287
     288    /* Install click listener: */
    295289    UIButtonTargetPrivate *bt = [[UIButtonTargetPrivate alloc] initWithObjectAndLionTrouble:this];
    296     [m_pNativeRef setTarget:bt];
    297     [m_pNativeRef setAction:@selector(clicked:)];
    298 
    299     /* Create the container widget and attach the native view. */
    300     m_pContainer = new QMacCocoaViewContainer(m_pNativeRef, this);
    301     /* Finally resize the widget */
     290    [pNativeRef setTarget:bt];
     291    [pNativeRef setAction:@selector(clicked:)];
     292
     293    /* Put the button to the QCocoaViewContainer: */
     294    setCocoaView(pNativeRef);
     295    /* Release our reference, since our super class
     296     * takes ownership and we don't need it anymore. */
     297    [pNativeRef release];
     298
     299    /* Finally resize the widget: */
    302300    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    303301    setFixedSize(NSWidth(initFrame), NSHeight(initFrame));
     302
     303    /* Cleanup auto-release pool: */
     304    [pool release];
    304305}
    305306
     
    310311QSize UICocoaButton::sizeHint() const
    311312{
    312     NSRect frame = [m_pNativeRef frame];
     313    NSRect frame = [nativeRef() frame];
    313314    return QSize(frame.size.width, frame.size.height);
    314315}
     
    318319    QString s(strText);
    319320    /* Set it for accessibility reasons as alternative title */
    320     [m_pNativeRef setAlternateTitle: ::darwinQStringToNSString(s.remove('&'))];
     321    [nativeRef() setAlternateTitle: ::darwinQStringToNSString(s.remove('&'))];
    321322}
    322323
    323324void UICocoaButton::setToolTip(const QString& strTip)
    324325{
    325     [m_pNativeRef setToolTip: ::darwinQStringToNSString(strTip)];
     326    [nativeRef() setToolTip: ::darwinQStringToNSString(strTip)];
    326327}
    327328
     
    331332}
    332333
    333 UICocoaSegmentedButton::UICocoaSegmentedButton(int count, CocoaSegmentType type /* = RoundRectSegment */, QWidget *pParent /* = 0 */)
    334   : UICocoaWrapper(pParent)
    335 {
     334UICocoaSegmentedButton::UICocoaSegmentedButton(QWidget *pParent, int count, CocoaSegmentType type /*= RoundRectSegment*/)
     335    : QMacCocoaViewContainer(0, pParent)
     336{
     337    /* Prepare auto-release pool: */
     338    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     339
     340    /* Prepare native segmented-button reference: */
     341    NativeNSSegmentedControlRef pNativeRef;
    336342    NSRect initFrame;
    337343
    338     m_pNativeRef = [[NSSegmentedControl alloc] init];
    339     [m_pNativeRef setSegmentCount:count];
     344    /* Configure segmented-button: */
     345    pNativeRef = [[NSSegmentedControl alloc] init];
     346    [pNativeRef setSegmentCount:count];
    340347    switch (type)
    341348    {
    342349        case RoundRectSegment:
    343350        {
    344             [[m_pNativeRef cell] setTrackingMode: NSSegmentSwitchTrackingMomentary];
    345             [m_pNativeRef setFont: [NSFont controlContentFontOfSize:
     351            [pNativeRef setSegmentStyle: NSSegmentStyleRoundRect];
     352            [pNativeRef setFont: [NSFont controlContentFontOfSize:
    346353                [NSFont systemFontSizeForControlSize: NSSmallControlSize]]];
    347             [m_pNativeRef setSegmentStyle:NSSegmentStyleRoundRect];
     354            [[pNativeRef cell] setTrackingMode: NSSegmentSwitchTrackingMomentary];
    348355            break;
    349356        }
    350357        case TexturedRoundedSegment:
    351358        {
    352             [m_pNativeRef setSegmentStyle:NSSegmentStyleTexturedRounded];
    353             [m_pNativeRef setFont: [NSFont controlContentFontOfSize:
     359            [pNativeRef setSegmentStyle: NSSegmentStyleTexturedRounded];
     360            [pNativeRef setFont: [NSFont controlContentFontOfSize:
    354361                [NSFont systemFontSizeForControlSize: NSSmallControlSize]]];
    355362            break;
    356363        }
    357364    }
    358     [m_pNativeRef sizeToFit];
    359 
     365
     366    /* Calculate corresponding size: */
     367    [pNativeRef sizeToFit];
     368    initFrame = [pNativeRef frame];
     369
     370    /* Install click listener: */
    360371    UISegmentedButtonTargetPrivate *bt = [[UISegmentedButtonTargetPrivate alloc] initWithObject1:this];
    361     [m_pNativeRef setTarget:bt];
    362     [m_pNativeRef setAction:@selector(segControlClicked:)];
    363 
    364     initFrame = [m_pNativeRef frame];
    365     /* Create the container widget and attach the native view. */
    366     m_pContainer = new QMacCocoaViewContainer(m_pNativeRef, this);
    367     /* Finally resize the widget */
     372    [pNativeRef setTarget:bt];
     373    [pNativeRef setAction:@selector(segControlClicked:)];
     374
     375    /* Put the button to the QCocoaViewContainer: */
     376    setCocoaView(pNativeRef);
     377    /* Release our reference, since our super class
     378     * takes ownership and we don't need it anymore. */
     379    [pNativeRef release];
     380
     381    /* Finally resize the widget: */
    368382    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    369383    setFixedSize(NSWidth(initFrame), NSHeight(initFrame));
     384
     385    /* Cleanup auto-release pool: */
     386    [pool release];
    370387}
    371388
     
    376393QSize UICocoaSegmentedButton::sizeHint() const
    377394{
    378     NSRect frame = [m_pNativeRef frame];
     395    NSRect frame = [nativeRef() frame];
    379396    return QSize(frame.size.width, frame.size.height);
    380397}
     
    383400{
    384401    QString s(strTitle);
    385     [m_pNativeRef setLabel: ::darwinQStringToNSString(s.remove('&')) forSegment: iSegment];
    386     [m_pNativeRef sizeToFit];
    387     NSRect frame = [m_pNativeRef frame];
     402    [nativeRef() setLabel: ::darwinQStringToNSString(s.remove('&')) forSegment: iSegment];
     403    [nativeRef() sizeToFit];
     404    NSRect frame = [nativeRef() frame];
    388405    setFixedSize(NSWidth(frame), NSHeight(frame));
    389406}
     
    391408void UICocoaSegmentedButton::setToolTip(int iSegment, const QString &strTip)
    392409{
    393     [[m_pNativeRef cell] setToolTip: ::darwinQStringToNSString(strTip) forSegment: iSegment];
     410    [[nativeRef() cell] setToolTip: ::darwinQStringToNSString(strTip) forSegment: iSegment];
    394411}
    395412
     
    399416
    400417    NSImage *pNSimage = [::darwinToNSImageRef(&image) autorelease];
    401     [m_pNativeRef setImage: pNSimage forSegment: iSegment];
    402     [m_pNativeRef sizeToFit];
    403     NSRect frame = [m_pNativeRef frame];
     418    [nativeRef() setImage: pNSimage forSegment: iSegment];
     419    [nativeRef() sizeToFit];
     420    NSRect frame = [nativeRef() frame];
    404421    setFixedSize(NSWidth(frame), NSHeight(frame));
    405422}
     
    407424void UICocoaSegmentedButton::setEnabled(int iSegment, bool fEnabled)
    408425{
    409     [[m_pNativeRef cell] setEnabled: fEnabled forSegment: iSegment];
     426    [[nativeRef() cell] setEnabled: fEnabled forSegment: iSegment];
    410427}
    411428
    412429void UICocoaSegmentedButton::animateClick(int iSegment)
    413430{
    414     [m_pNativeRef setSelectedSegment: iSegment];
    415     [[m_pNativeRef cell] performClick: m_pNativeRef];
     431    [nativeRef() setSelectedSegment: iSegment];
     432    [[nativeRef() cell] performClick: nativeRef()];
    416433}
    417434
     
    421438}
    422439
    423 UICocoaSearchField::UICocoaSearchField(QWidget *pParent /* = 0 */)
    424   : UICocoaWrapper(pParent)
    425 {
     440UICocoaSearchField::UICocoaSearchField(QWidget *pParent)
     441    : QMacCocoaViewContainer(0, pParent)
     442{
     443    /* Prepare auto-release pool: */
     444    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     445
     446    /* Prepare native search-field reference: */
     447    NativeNSSearchFieldRef pNativeRef;
    426448    NSRect initFrame;
    427449
    428     m_pNativeRef = [[UISearchFieldPrivate alloc] initWithObject2: this];
    429     [m_pNativeRef setFont: [NSFont controlContentFontOfSize:
     450    /* Configure search-field: */
     451    pNativeRef = [[UISearchFieldPrivate alloc] initWithObject2: this];
     452    [pNativeRef setFont: [NSFont controlContentFontOfSize:
    430453        [NSFont systemFontSizeForControlSize: NSMiniControlSize]]];
    431     [[m_pNativeRef cell] setControlSize: NSMiniControlSize];
    432     [m_pNativeRef sizeToFit];
    433     initFrame = [m_pNativeRef frame];
     454    [[pNativeRef cell] setControlSize: NSMiniControlSize];
     455    [pNativeRef sizeToFit];
     456    initFrame = [pNativeRef frame];
    434457    initFrame.size.width = 180;
    435     [m_pNativeRef setFrame: initFrame];
    436 
    437     /* Use our own delegate */
     458    [pNativeRef setFrame: initFrame];
     459
     460    /* Use our own delegate: */
    438461    UISearchFieldDelegatePrivate *sfd = [[UISearchFieldDelegatePrivate alloc] init];
    439     [m_pNativeRef setDelegate: sfd];
    440 
    441     /* Create the container widget and attach the native view. */
    442     m_pContainer = new QMacCocoaViewContainer(m_pNativeRef, this);
    443 
    444     /* Finally resize the widget */
     462    [pNativeRef setDelegate: sfd];
     463
     464    /* Put the button to the QCocoaViewContainer: */
     465    setCocoaView(pNativeRef);
     466    /* Release our reference, since our super class
     467     * takes ownership and we don't need it anymore. */
     468    [pNativeRef release];
     469
     470    /* Finally resize the widget: */
    445471    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    446472    setMinimumWidth(NSWidth(initFrame));
    447473    setFixedHeight(NSHeight(initFrame));
    448474    setFocusPolicy(Qt::StrongFocus);
     475
     476    /* Cleanup auto-release pool: */
     477    [pool release];
    449478}
    450479
     
    455484QSize UICocoaSearchField::sizeHint() const
    456485{
    457     NSRect frame = [m_pNativeRef frame];
     486    NSRect frame = [nativeRef() frame];
    458487    return QSize(frame.size.width, frame.size.height);
    459488}
     
    461490QString UICocoaSearchField::text() const
    462491{
    463     return ::darwinNSStringToQString([m_pNativeRef stringValue]);
     492    return ::darwinNSStringToQString([nativeRef() stringValue]);
    464493}
    465494
    466495void UICocoaSearchField::insert(const QString &strText)
    467496{
    468     [[m_pNativeRef currentEditor] setString: [[m_pNativeRef stringValue] stringByAppendingString: ::darwinQStringToNSString(strText)]];
     497    [[nativeRef() currentEditor] setString: [[nativeRef() stringValue] stringByAppendingString: ::darwinQStringToNSString(strText)]];
    469498}
    470499
    471500void UICocoaSearchField::setToolTip(const QString &strTip)
    472501{
    473     [m_pNativeRef setToolTip: ::darwinQStringToNSString(strTip)];
     502    [nativeRef() setToolTip: ::darwinQStringToNSString(strTip)];
    474503}
    475504
    476505void UICocoaSearchField::selectAll()
    477506{
    478     [m_pNativeRef selectText: m_pNativeRef];
     507    [nativeRef() selectText: nativeRef()];
    479508}
    480509
    481510void UICocoaSearchField::markError()
    482511{
    483     [[m_pNativeRef cell] setBackgroundColor: [[NSColor redColor] colorWithAlphaComponent: 0.3]];
     512    [[nativeRef() cell] setBackgroundColor: [[NSColor redColor] colorWithAlphaComponent: 0.3]];
    484513}
    485514
    486515void UICocoaSearchField::unmarkError()
    487516{
    488     [[m_pNativeRef cell] setBackgroundColor: nil];
     517    [[nativeRef() cell] setBackgroundColor: nil];
    489518}
    490519
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp

    r52733 r54055  
    233233    : QIWithRetranslateUI<QWidget>(pParent)
    234234{
    235     /* Prepare buttons: */
    236     m_pHeaderBtn = new UITexturedSegmentedButton(2);
    237     m_pHeaderBtn->setIcon(Dtls, UIIconPool::iconSet(":/vm_settings_16px.png",
    238                                                     ":/vm_settings_disabled_16px.png"));
    239     m_pHeaderBtn->setIcon(Snap, UIIconPool::iconSet(":/snapshot_take_16px.png",
    240                                                     ":/snapshot_take_disabled_16px.png"));
     235    /* Create container: */
     236    QWidget *pContainer = new QWidget;
     237    {
     238        /* Create layout: */
     239        QHBoxLayout *pLayout = new QHBoxLayout(pContainer);
     240        {
     241            /* Configure layout: */
     242            pLayout->setContentsMargins(0, 0, 0, 0);
     243            /* Create segmented-button: */
     244            m_pHeaderBtn = new UITexturedSegmentedButton(pContainer, 2);
     245            {
     246                /* Configure segmented-button: */
     247                m_pHeaderBtn->setIcon(Dtls, UIIconPool::iconSet(":/vm_settings_16px.png",
     248                                                                ":/vm_settings_disabled_16px.png"));
     249                m_pHeaderBtn->setIcon(Snap, UIIconPool::iconSet(":/snapshot_take_16px.png",
     250                                                                ":/snapshot_take_disabled_16px.png"));
     251                /* Add segmented-buttons into layout: */
     252                pLayout->addWidget(m_pHeaderBtn);
     253            }
     254        }
     255    }
     256
    241257#ifdef Q_WS_MAC
    242258    /* Cocoa stuff should be async...
     
    258274    {
    259275        pToolBar->addWidget(new UIHorizontalSpacerWidget(this));
    260         pToolBar->addWidget(m_pHeaderBtn);
     276        pToolBar->addWidget(pContainer);
    261277        QWidget *pSpace = new QWidget(this);
    262278        /* We need a little bit more space for the beta label. */
     
    276292    {
    277293        UIBar *pBar = new UIBar(this);
    278         pBar->setContentWidget(m_pHeaderBtn);
     294        pBar->setContentWidget(pContainer);
    279295        pMainLayout->addWidget(pBar);
    280296    }
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISpecialControls.cpp

    r52731 r54055  
    4141{
    4242    setShortcut(QKeySequence(Qt::Key_Escape));
    43     m_pButton = new UICocoaButton(UICocoaButton::CancelButton, this);
     43    m_pButton = new UICocoaButton(this, UICocoaButton::CancelButton);
    4444    connect(m_pButton, SIGNAL(clicked()),
    4545            this, SIGNAL(clicked()));
     
    6060  : QAbstractButton(pParent)
    6161{
    62     m_pButton = new UICocoaButton(UICocoaButton::ResetButton, this);
     62    m_pButton = new UICocoaButton(this, UICocoaButton::ResetButton);
    6363    connect(m_pButton, SIGNAL(clicked()),
    6464            this, SIGNAL(clicked()));
     
    8080{
    8181    setShortcut(QKeySequence(QKeySequence::HelpContents));
    82     m_pButton = new UICocoaButton(UICocoaButton::HelpButton, this);
     82    m_pButton = new UICocoaButton(this, UICocoaButton::HelpButton);
    8383    connect(m_pButton, SIGNAL(clicked()),
    8484            this, SIGNAL(clicked()));
     
    9191 *
    9292 ********************************************************************************/
    93 UIRoundRectSegmentedButton::UIRoundRectSegmentedButton(int cCount, QWidget *pParent /* = 0 */)
    94   : UICocoaSegmentedButton(cCount, UICocoaSegmentedButton::RoundRectSegment, pParent)
    95 {
    96 }
    97 
    98 UITexturedSegmentedButton::UITexturedSegmentedButton(int cCount, QWidget *pParent /* = 0 */)
    99   : UICocoaSegmentedButton(cCount, UICocoaSegmentedButton::TexturedRoundedSegment, pParent)
     93UIRoundRectSegmentedButton::UIRoundRectSegmentedButton(QWidget *pParent, int cCount)
     94  : UICocoaSegmentedButton(pParent, cCount, UICocoaSegmentedButton::RoundRectSegment)
     95{
     96}
     97
     98UITexturedSegmentedButton::UITexturedSegmentedButton(QWidget *pParent, int cCount)
     99  : UICocoaSegmentedButton(pParent, cCount, UICocoaSegmentedButton::TexturedRoundedSegment)
    100100{
    101101}
     
    126126 *
    127127 ********************************************************************************/
    128 UIMiniCancelButton::UIMiniCancelButton(QWidget *pParent /* = 0 */)
     128UIMiniCancelButton::UIMiniCancelButton(QWidget *pParent /*= 0*/)
    129129  : QIWithRetranslateUI<QIToolButton>(pParent)
    130130{
     
    146146static const int PushButtonBottomOffset = 4;
    147147
    148 UIHelpButton::UIHelpButton(QWidget *pParent /* = 0 */)
     148UIHelpButton::UIHelpButton(QWidget *pParent /*= 0*/)
    149149    : QIWithRetranslateUI<QPushButton>(pParent)
    150150{
     
    240240 *
    241241 ********************************************************************************/
    242 UIRoundRectSegmentedButton::UIRoundRectSegmentedButton(int aCount, QWidget *pParent /* = 0 */)
     242UIRoundRectSegmentedButton::UIRoundRectSegmentedButton(QWidget *pParent, int aCount)
    243243  : QWidget(pParent)
    244244{
     
    294294}
    295295
    296 UITexturedSegmentedButton::UITexturedSegmentedButton(int cCount, QWidget *pParent /* = 0 */)
    297   : UIRoundRectSegmentedButton(cCount, pParent)
     296UITexturedSegmentedButton::UITexturedSegmentedButton(QWidget *pParent, int cCount)
     297  : UIRoundRectSegmentedButton(pParent, cCount)
    298298{
    299299    for (int i=0; i < m_pButtons.size(); ++i)
     
    309309 *
    310310 ********************************************************************************/
    311 UISearchField::UISearchField(QWidget *pParent /* = 0 */)
     311UISearchField::UISearchField(QWidget *pParent)
    312312  : QLineEdit(pParent)
    313313{
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISpecialControls.h

    r52727 r54055  
    110110
    111111public:
    112     UIRoundRectSegmentedButton(int cCount, QWidget *pParent = 0);
     112    UIRoundRectSegmentedButton(QWidget *pParent, int cCount);
    113113};
    114114
     
    118118
    119119public:
    120     UITexturedSegmentedButton(int cCount, QWidget *pParent = 0);
     120    UITexturedSegmentedButton(QWidget *pParent, int cCount);
    121121};
    122122
     
    131131
    132132public:
    133     UISearchField(QWidget *pParent = 0);
     133    UISearchField(QWidget *pParent);
    134134};
    135135
     
    227227
    228228public:
    229     UIRoundRectSegmentedButton(int aCount, QWidget *pParent = 0);
     229    UIRoundRectSegmentedButton(QWidget *pParent, int aCount);
    230230    ~UIRoundRectSegmentedButton();
    231231
     
    251251
    252252public:
    253     UITexturedSegmentedButton(int cCount, QWidget *pParent = 0);
     253    UITexturedSegmentedButton(QWidget *pParent, int cCount);
    254254};
    255255
     
    264264
    265265public:
    266     UISearchField(QWidget *pParent = 0);
     266    UISearchField(QWidget *pParent);
    267267
    268268    void markError();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette