qt-interest@trolltech.com
[Top] [All Lists]

RE: setTabBar protected?

Subject: RE: setTabBar protected?
From: "Scott Aron Bloom"
Date: Fri, 5 May 2006 18:48:22 -0700

Once again… the documentation comes to the rescue

Protected Functions

 

 


From: InsaneToucan [mailto:insanetoucan@xxxxxxxxx]
Sent: Friday, May 05, 2006 9:24 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: setTabBar protected?

 

#include <QApplication>
#include <QtGui>
#include <QIcon>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QDialog* dialog = new QDialog;
    QHBoxLayout* la = new QHBoxLayout;
    dialog->setLayout(la);
    QTabWidget tab;
    QTabBar tabbar;
    la->addWidget(&tab);
    
    QToolButton* closeTabButton = new QToolButton(dialog);
    tab.setCornerWidget( closeTabButton, Qt::TopRightCorner );
    
    QLabel l;
    l.setText("Test1");
    tab.setTabBar(&tabbar);
    tab.addTab(&l, "test1");
    dialog->show();
    return app.exec();
}

The code above errors with:

error: `void QTabWidget::setTabBar(QTabBar*)' is protected
error: within this context

Is this a bug or my oversight?

 TIA

<Prev in Thread] Current Thread [Next in Thread>