コード例 #1
0
void ModelObserver::notifyChangeName(const std::string &name)
{
	if(!node->isGroup())
		return;
	//{
		//int i = 0;
		QMap<QWidget *, SimulationTab*> tabs = node->getSimulation()->getTabs();

		QTabWidget* tabWidget = node->getSimulation()->getTabWidget();
		for (int i = 0; i < tabWidget->count(); i++) {
			if ( (DM::Module*) tabs[tabWidget->widget(i)]->getParentGroup() == node->getModule() )
				tabWidget->setTabText(i, QString::fromStdString(name));
		}

		/*foreach(SimulationTab* tab, tabs)
		{
			if(((DM::Module*)tab->getParentGroup()) == node->getModule())
				break;
			else
				i++;
		}
		if(i < tabs.size())
			node->getSimulation()->getTabWidget()->setTabText(i, QString::fromStdString(name));
			*/
	//}
}
コード例 #2
0
void PluginTextEditor::closeFileRequest(QString file)
{
	QTabWidget *tabwidget = IPlatform::getInstance()->getWindowManager()->getWindow()->getTabWidget();
	for(int i = 0; i < tabwidget->count(); i++)
	{
		if(file.compare(tabwidget->tabText(i)) == 0)
		{
			if(tabwidget->tabText(i).compare(QString(tr("Welcome"))) == 0)
			{
				QWidget *widget = tabwidget->widget(i);
				tabwidget->removeTab(i);
				delete widget;
			}
			else
			{
				ProjectManager * projectmanager = IPlatform::getInstance()->getProjectManager();
				if(projectmanager->getProject())
				{
					projectmanager->closeFile(file);
				}
			}
			break;
		}
	}
}
コード例 #3
0
QWidget *QTabWidgetProto::widget(int index) const
{
  QTabWidget *item = qscriptvalue_cast<QTabWidget*>(thisObject());
  if (item)
    return item->widget(index);
  return 0;
}
コード例 #4
0
QWidget * ScriptToolbox::tabWidget(QWidget * tab, int idx)
{
  QTabWidget *tw = qobject_cast<QTabWidget*>(tab);
  QWidget * w = 0;
  if(tw)
    w = tw->widget(idx);
  return w;
}
コード例 #5
0
void MainWindow::configurate()
{
    if(_paramDiag->exec()) {
        QTabWidget *qtw = _paramDiag->layerTabWidget;
        for(int i = 0; i<qtw->count(); ++i) {
            LayerParameters * ll = static_cast<LayerParameters*> (qtw->widget(i));
            qDebug("%f", ll->youngDoubleSpinBox->value());
        }
    }
}
コード例 #6
0
void DlgPreferencesImp::applyChanges()
{
    try {
        for (int i=0; i<ui->tabWidgetStack->count(); i++) {
            QTabWidget* tabWidget = (QTabWidget*)ui->tabWidgetStack->widget(i);
            for (int j=0; j<tabWidget->count(); j++) {
                QWidget* page = tabWidget->widget(j);
                int index = page->metaObject()->indexOfMethod("checkSettings()");
                try {
                    if (index >= 0) {
                        page->qt_metacall(QMetaObject::InvokeMetaMethod, index, 0);
                    }
                }
                catch (const Base::Exception& e) {
                    ui->listBox->setCurrentRow(i);
                    tabWidget->setCurrentIndex(j);
                    QMessageBox::warning(this, tr("Wrong parameter"), QString::fromAscii(e.what()));
                    throw;
                }
            }
        }
    } catch (const Base::Exception&) {
        this->invalidParameter = true;
        return;
    }

    for (int i=0; i<ui->tabWidgetStack->count(); i++) {
        QTabWidget* tabWidget = (QTabWidget*)ui->tabWidgetStack->widget(i);
        for (int j=0; j<tabWidget->count(); j++) {
            PreferencePage* page = qobject_cast<PreferencePage*>(tabWidget->widget(j));
            if (page)
                page->saveSettings();
        }
    }

    bool saveParameter = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")->
                          GetBool("SaveUserParameter", true);
    if (saveParameter) {
        ParameterManager* parmgr = App::GetApplication().GetParameterSet("User parameter");
        parmgr->SaveDocument(App::Application::Config()["UserParameter"].c_str());
    }
}
コード例 #7
0
void PluginTextEditor::closeFile(QString file)
{
	QTabWidget *tabwidget = IPlatform::getInstance()->getWindowManager()->getWindow()->getTabWidget();
	for(int i = 0; i < tabwidget->count(); i++)
	{
		if(file.compare(tabwidget->tabText(i)) == 0)
		{
			QWidget *widget = tabwidget->widget(i);
			tabwidget->removeTab(i);
			delete widget;
		}
	}
}
コード例 #8
0
QWidget *TilesetItemBox::findTabWidget(const QString &categoryItem)
{
    #ifdef _DEBUG_
    WriteToLog(QtDebugMsg, "TilesetBox -> find Tab");
    #endif
    QTabWidget *cat = ui->TileSetsCategories;
    for(int i = 0; i < cat->count(); ++i)
    {
        if(cat->tabText(i) == categoryItem)
            return cat->widget(i);
    }
    return 0;
}
コード例 #9
0
SelectorActionItem *VBoxSettingsToolBarSelector::findActionItemByTabWidget (QTabWidget* aTabWidget, int aIndex) const
{
    SelectorActionItem *result = NULL;
    foreach (SelectorItem *item, mItemList)
        if (static_cast<SelectorActionItem*> (item)->tabWidget() == aTabWidget)
        {
            QTabWidget *tw = static_cast<SelectorActionItem*> (item)->tabWidget();
            result = static_cast<SelectorActionItem*> (
                findItemByPage (static_cast<UISettingsPage*> (tw->widget (aIndex))));
            break;
        }

    return result;

}
コード例 #10
0
void Prefs::changeEvent(QEvent *e) {
    if (e->type() == QEvent::LanguageChange) {
        retranslateUi(this);
        // update the widgets' tabs
        for (int i=0; i<tabWidgetStack->count(); i++) {
            QTabWidget* tabWidget = (QTabWidget*)tabWidgetStack->widget(i);
            for (int j=0; j<tabWidget->count(); j++) {
                QWidget* page = tabWidget->widget(j);
                tabWidget->setTabText(j, page->windowTitle());
            }
        }
        // update the items' text
        for (int i=0; i<listBox->count(); i++) {
            QListWidgetItem *item = listBox->item(i);
            QByteArray group = item->data(Qt::UserRole).toByteArray();
            item->setText(QObject::tr(group.constData()));
        }
    } else {
        QWidget::changeEvent(e);
    }
}
コード例 #11
0
void TilesetItemBox::clearTilesetGroups()
{
    if(lockTilesetBox) return;

    QTabWidget *cat = ui->TileSetsCategories;
    int i = 0;
    int f = cat->count();
    while(f > i)
    {
        //include custom tab
        if(cat->tabText(i) == "Custom")
        {
            ++i;
            continue;
        }

        QWidget *acCat = cat->widget(i);
        cat->removeTab(i);
        delete acCat;
        f = cat->count();
    }
}
コード例 #12
0
void Monofin::configurate()
{
    int nbLayers = _projectFile->getHowManyLayers();
    _paramDiag->setNbLayers(nbLayers);
    for (int i=0; i < nbLayers; ++i) {
        _paramDiag->updateLayerDensity(i, _projectFile->getLayerConfigRho(i));
        _paramDiag->updateLayerPoissonRatio(i, _projectFile->getLayerConfigPoisson(i));
        _paramDiag->updateLayerYoungModulus(i, _projectFile->getLayerConfigYoung(i));
    }
    if(_paramDiag->exec()) {
        QTabWidget *qtw = _paramDiag->layerTabWidget;
        if (qtw->count() > 0) {
            _projectFile->startHistory(Data::MonofinLayerConfig);
            for(int i = 0; i<qtw->count(); ++i) {
                LayerParameters * ll = static_cast<LayerParameters*> (qtw->widget(i));
                _projectFile->setLayerConfigPoisson(i, ll->poissonDoubleSpinBox->value());
                _projectFile->setLayerConfigRho(i, ll->densityDoubleSpinBox->value());
                _projectFile->setLayerConfigYoung(i, ll->youngDoubleSpinBox->value());
            }
            _projectFile->stopHistory(Data::MonofinLayerConfig);
        }
    }
}
コード例 #13
0
bool FrameAttachmentPoint::attach(AttachableFrame* frame)
{
    QLayout* layout;
    QWidget* attWidget;
    QFrame* attFrame;
    QDockWidget* attDockWidget;
    QTabWidget* attTabWidget;
    QMainWindow* attMainWindow;
    int index = 0;

    if ((int)mAttachedFrames.size() >= mMaxAttachmentCount)
    {
        LOG_ERROR() << "FrameAttachmentPoint::attach(): cannot attach more than " << mMaxAttachmentCount <<
                       " Frame" << (mMaxAttachmentCount > 1 ? "s" : "") << " to Attachment Point " << mName << ".";
       return false;
    }

    //Attach the frame in a way depending on its type
    switch (mType)
    {
    case ATTACHMENT_NONE:
         LOG_ERROR() << "FrameAttachmentPoint::attach(): cannot attach to illegal Attachment Point.";
         return false;
        break;
    case ATTACHMENT_WIDGET:
        //Attach to Widget with adding a new layout
        layout = WindowManager::createNeutralLayout();
        layout->addWidget(&*frame);
        frame->show();
        attWidget = (dynamic_cast<QWidget*>(mAttachmentPoint));
        attWidget->setLayout(layout);
        attWidget->show();
        break;
    case ATTACHMENT_FRAME:
        //Attach to Frame with adding a new layout
        layout = WindowManager::createNeutralLayout();
        layout->addWidget(&*frame);
        frame->show();
        attFrame = (dynamic_cast<QFrame*>(mAttachmentPoint));
        attFrame->setLayout(layout);
        attFrame->show();
        break;
    case ATTACHMENT_TABWIDGET:
        //Attach to TabWidget with adding a new page and (automatically) a layout
        attTabWidget = (dynamic_cast<QTabWidget*>(mAttachmentPoint));
        index = attTabWidget->addTab(&*frame, frame->getCaption());
        WindowManager::changeToNeutralLayout(attTabWidget->widget(index)->layout());
        break;
    case ATTACHMENT_DOCKWIDGET:
        //Attach to DockWidget with adding a new layout
        layout = WindowManager::createNeutralLayout();
        layout->addWidget(&*frame);
        frame->show();
        attDockWidget = (dynamic_cast<QDockWidget*>(mAttachmentPoint));
        attDockWidget->setLayout(layout);
        attDockWidget->show();
        break;
    case ATTACHMENT_MAINWINDOW:
        //Attach to MainWindow with adding a new layout
        layout = WindowManager::createNeutralLayout();
        layout->addWidget(&*frame);
        frame->show();
        attMainWindow = (dynamic_cast<QMainWindow*>(mAttachmentPoint));
        attMainWindow->setLayout(layout);
        attMainWindow->show();
        break;
    default:
         LOG_ERROR() << "FrameAttachmentPoint::attach(): unknown Attachment Point.";
        return false;
        break;
    }

    //Store the attachment pointer
    mAttachedFrames.insert(frame->getPluginId(), frame);

    return true;
}
コード例 #14
0
void TilesetItemBox::makeSelectedTileset(int tabIndex)
{
    if(lockTilesetBox)
        return;

    QGraphicsScene *scene = NULL;

    LevelEdit *lvlEdit = mw()->activeLvlEditWin();
    WorldEdit *wldEdit = mw()->activeWldEditWin();

    if((lvlEdit) && (lvlEdit->sceneCreated))
        scene = lvlEdit->scene;
    else if((wldEdit) && (wldEdit->sceneCreated))
        scene = wldEdit->scene;

    QTabWidget *cat = ui->TileSetsCategories;
    if(!(cat->tabText(tabIndex) == "Custom"))
    {
        QWidget *current = cat->widget(tabIndex);
        if(!current)
            return;

        QString category = cat->tabText(tabIndex);

        #ifdef _DEBUG_
        DevConsole::log(QString("Category %1").arg(cat->tabText(cat->currentIndex())), "Debug");
        #endif

        QScrollArea *currentFrame   = getFrameTilesetOfTab(current);
        QComboBox   *currentCombo   = getGroupComboboxOfTab(current);
        if(!currentFrame || !currentCombo)
            return;

        QWidget *scrollWid = currentFrame->widget();
        if(!scrollWid)
            return;

        qDeleteAll(scrollWid->findChildren<QGroupBox *>());

        if(scrollWid->layout() == 0)
            scrollWid->setLayout(new FlowLayout());

        currentFrame->setWidgetResizable(true);

        #ifdef _DEBUG_
        DevConsole::log(QString("size %1 %2")
                        .arg(scrollWid->layout()->geometry().width())
                        .arg(scrollWid->layout()->geometry().height())
                        , "Debug");
        #endif

        QString currentGroup = currentCombo->currentText();
        for(int i = 0; i < mw()->configs.main_tilesets_grp.size(); i++)
        {
            if((mw()->configs.main_tilesets_grp[i].groupCat == category)
               && (mw()->configs.main_tilesets_grp[i].groupName == currentGroup)) //category
            {
                #ifdef _DEBUG_
                DevConsole::log(QString("Group %1").arg(configs.main_tilesets_grp[i].groupName), "Debug");
                DevConsole::log(QString("Tilesets %1").arg(configs.main_tilesets_grp[i].tilesets.size()), "Debug");
                #endif

                QStringList l = mw()->configs.main_tilesets_grp[i].tilesets;
                foreach(QString s, l)
                {
                    for(int j = 0; j < mw()->configs.main_tilesets.size(); j++)
                    {
                        if(s == mw()->configs.main_tilesets[j].fileName)
                        {
                            SimpleTileset &s = mw()->configs.main_tilesets[j];
                            QGroupBox *tilesetNameWrapper = new QGroupBox(s.tileSetName, scrollWid);
                            ((FlowLayout *)scrollWid->layout())->addWidget(tilesetNameWrapper);
                            QGridLayout *l = new QGridLayout(tilesetNameWrapper);
                            l->setContentsMargins(4, 4, 4, 4);
                            l->setSpacing(2);
                            for(int k = 0; k < s.items.size(); k++)
                            {
                                SimpleTilesetItem &item = s.items[k];
                                TilesetItemButton *tbutton = new TilesetItemButton(&mw()->configs, scene, tilesetNameWrapper);
                                tbutton->applySize(32, 32);
                                tbutton->applyItem(s.type, item.id);
                                l->addWidget(tbutton, item.row, item.col);
                                connect(tbutton, SIGNAL(clicked(int, ulong)), mw(), SLOT(SwitchPlacingItem(int, ulong)));
                            }
                            break;
                        }
                    }
                }
                break;
            }
        }
コード例 #15
0
ファイル: main.cpp プロジェクト: Xambey/something
int main (int argc, char** argv)
{
    QApplication app(argc, argv);
    QWidget wgt;
    QStringList list;
    list << "1" << "2" << "3" <<"4";

    QTableWidget mytable(4, 5);
    QTableWidgetItem* pw = NULL;
    mytable.setHorizontalHeaderLabels(list);
    mytable.setVerticalHeaderLabels(list);

    QBrush br(Qt::BackgroundColorRole, Qt::NoBrush);


    for(int i(0);i < 4; i++)
        for(int j(0); j < 5; j++){
            pw = new QTableWidgetItem(QString("%10, %11").arg(i).arg(j));
            pw->setBackground(br);
            //pw->setBackgroundColor(QColor::black());
            //pw->setBackgroundColor(&c);
            mytable.setItem(i, j, pw);
        }
    QComboBox* box = new QComboBox;
    box->addItems(list);
    QString str ("111");
    QTabWidget tab;
//    foreach(QString str, list){
//        tab.addTab(new QLabel(str, &tab), str);
//    }
    QLabel* la = new QLabel(str, &tab);
    tab.addTab(la, QString("1"));
    tab.addTab(new QLineEdit, str);
    QToolBox * gg = new QToolBox;
    gg->addItem(new QLineEdit, QString("222"));


    QLabel* plblDisplay = new QLabel;

    plblDisplay->setFrameStyle(QFrame::Box | QFrame::Raised);
    plblDisplay->setLineWidth(5);
    plblDisplay->setFixedHeight(50);

    QLabel* plblText = new QLabel("&Text:");

    QLineEdit* text = new QLineEdit;

    text->setInputMask("0-(000)-000-00-00");
    QLineEdit* text3 = new QLineEdit;

    text3->setInputMask("0-(000)-000-00-00");
    tab.addTab(text3, QString("0-(000)-000-00-00"));
    QWidget::connect(tab.widget(0), SIGNAL(objectNameChanged(QString)),tab.widget(2), SLOT(setEnabled(bool)));




    QTextEdit* text2 = new QTextEdit;
    text2->setHtml("<html><div><center><h3>I wrote the HTML</h3></center></div></html>");
    MyHighlighter* pHighlighter = new MyHighlighter(text2->document());

    QLineEdit* ptxt = new QLineEdit;
    plblText->setBuddy(ptxt);

    QObject::connect(ptxt, SIGNAL(textChanged(const QString&)),
    plblDisplay, SLOT(setText(const QString&))
    );

    QObject::connect(text, SIGNAL(textChanged(const QString&)),
    plblDisplay, SLOT(setText(const QString&))
    );

    QObject::connect(text2, SIGNAL(windowTitleChanged(QString)),
    plblDisplay, SLOT(setText(const QString&))
    );

    QLabel* plblPassword = new QLabel("&Password:");

    QLineEdit* ptxtPassword = new QLineEdit;

    plblPassword->setBuddy(ptxtPassword);
    ptxtPassword->setEchoMode(QLineEdit::Password);
    ptxtPassword->setValidator(new QIntValidator);

    QObject::connect(ptxtPassword, SIGNAL(textChanged(const QString&)),
    plblDisplay, SLOT(setText(const QString&))
    );
    //Layout setup
    QVBoxLayout* pvbxLayout = new QVBoxLayout;

    pvbxLayout->addWidget(plblDisplay);
    pvbxLayout->addWidget(plblText);
    pvbxLayout->addWidget(ptxt);
    pvbxLayout->addWidget(plblPassword);
    pvbxLayout->addWidget(ptxtPassword);
    pvbxLayout->addWidget(text);
    pvbxLayout->addWidget(text2);
    pvbxLayout->addWidget(box);
    pvbxLayout->addWidget(&tab);
    pvbxLayout->addWidget(&mytable);
    pvbxLayout->addWidget(gg);

    wgt.setLayout(pvbxLayout);
    wgt.show();
    return app.exec();
}
コード例 #16
0
ファイル: AvatarEditor.cpp プロジェクト: enne/naali
void AvatarEditor::RebuildEditView()
{
    if (!avatar_widget_)
        return;

    // Activate/deactivate export button based on whether export currently supported
    QPushButton *button = avatar_widget_->findChild<QPushButton *>("but_export");
    if (button)
        button->setEnabled(rexlogicmodule_->GetAvatarHandler()->AvatarExportSupported());

    QWidget* mat_panel = avatar_widget_->findChild<QWidget *>("panel_materials");
    QWidget* attachment_panel = avatar_widget_->findChild<QWidget *>("panel_attachments");
    if (!mat_panel || !attachment_panel)
        return;

    Scene::EntityPtr entity = rexlogicmodule_->GetAvatarHandler()->GetUserAvatar();
    if (!entity)
        return;
    EC_AvatarAppearance* appearance = entity->GetComponent<EC_AvatarAppearance>().get();
    if (!appearance)
        return;

    int width = 308-10;
    int tab_width = 302-10;
    int itemheight = 20;

    // Materials
    ClearPanel(mat_panel);
    const AvatarMaterialVector& materials = appearance->GetMaterials();
    mat_panel->resize(width, itemheight * (materials.size() + 1));

    for (uint y = 0; y < materials.size(); ++y)
    {
        QPushButton* button = new QPushButton("Change", mat_panel);
        button->setObjectName(QString::fromStdString(ToString<int>(y))); // Material index
        button->resize(50, 20);
        button->move(width - 50, y*itemheight);
        button->show();

        QObject::connect(button, SIGNAL(clicked()), this, SLOT(ChangeTexture()));
        // If there's a texture name, use it, because it is probably more understandable than material name
        std::string texname = materials[y].asset_.name_;
        if (materials[y].textures_.size())
            texname = materials[y].textures_[0].name_;

        QLabel* label = new QLabel(QString::fromStdString(texname), mat_panel);
        label->resize(200,20);
        label->move(0, y*itemheight);
        label->show();
    }

    // Attachments
    ClearPanel(attachment_panel);
    const AvatarAttachmentVector& attachments = appearance->GetAttachments();
    attachment_panel->resize(width, itemheight * (attachments.size() + 1));

    for (uint y = 0; y < attachments.size(); ++y)
    {
        QPushButton* button = new QPushButton("Remove", attachment_panel);
        button->setObjectName(QString::fromStdString(ToString<int>(y))); // Attachment index
        button->resize(50, 20);
        button->move(width - 50, y*itemheight);
        button->show();

        QObject::connect(button, SIGNAL(clicked()), this, SLOT(RemoveAttachment()));

        std::string attachment_name = attachments[y].name_;
        // Strip away .xml from the attachment name for slightly nicer display
        std::size_t pos = attachment_name.find(".xml");
        if (pos != std::string::npos)
            attachment_name = attachment_name.substr(0, pos);

        QLabel* label = new QLabel(QString::fromStdString(attachment_name), attachment_panel);
        label->resize(200,20);
        label->move(0, y*itemheight);
        label->show();
    }

    // Modifiers
    QTabWidget* tabs = avatar_widget_->findChild<QTabWidget *>("tab_appearance");
    if (!tabs)
        return;
    for (;;)
    {
        QWidget* tab = tabs->widget(0);
        if (!tab)
            break;
        tabs->removeTab(0);
        delete tab;
    }

    const MasterModifierVector& master_modifiers = appearance->GetMasterModifiers();
    // If no master modifiers, show the individual morph/bone controls
    if (!master_modifiers.size())
    {
        QWidget* morph_panel = GetOrCreateTabScrollArea(tabs, "Morphs");
        QWidget* bone_panel = GetOrCreateTabScrollArea(tabs, "Bones");
        if (!morph_panel || !bone_panel)
            return;

        const BoneModifierSetVector& bone_modifiers = appearance->GetBoneModifiers();
        const MorphModifierVector& morph_modifiers = appearance->GetMorphModifiers();
        morph_panel->resize(tab_width, itemheight * (morph_modifiers.size() + 1));
        bone_panel->resize(tab_width, itemheight * (bone_modifiers.size() + 1));

        for (uint i = 0; i < bone_modifiers.size(); ++i)
        {
            QScrollBar* slider = new QScrollBar(Qt::Horizontal, bone_panel);
            slider->setObjectName(QString::fromStdString(bone_modifiers[i].name_));
            slider->setMinimum(0);
            slider->setMaximum(100);
            slider->setPageStep(10);
            slider->setValue(bone_modifiers[i].value_ * 100.0f);
            slider->resize(150, 20);
            slider->move(tab_width - 150, i * itemheight);
            slider->show();

            QObject::connect(slider, SIGNAL(valueChanged(int)), this, SLOT(BoneModifierValueChanged(int)));

            QLabel* label = new QLabel(QString::fromStdString(bone_modifiers[i].name_), bone_panel);
            label->resize(100,20);
            label->move(0, i * itemheight);
            label->show();
        }

        for (uint i = 0; i < morph_modifiers.size(); ++i)
        {
            QScrollBar* slider = new QScrollBar(Qt::Horizontal, morph_panel);
            slider->setObjectName(QString::fromStdString(morph_modifiers[i].name_));
            slider->setMinimum(0);
            slider->setMaximum(100);
            slider->setPageStep(10);
            slider->setValue(morph_modifiers[i].value_ * 100.0f);
            slider->resize(150, 20);
            slider->move(tab_width - 150, i * itemheight);
            slider->show();

            QObject::connect(slider, SIGNAL(valueChanged(int)), this, SLOT(MorphModifierValueChanged(int)));

            QLabel* label = new QLabel(QString::fromStdString(morph_modifiers[i].name_), morph_panel);
            label->resize(100,20);
            label->move(0, i * itemheight);
            label->show();
        }
    }
コード例 #17
0
ファイル: QtlTabWidget.cpp プロジェクト: Wushaowei001/NAF
int TabWidget::widget( lua_State * L ) //( int index ) const QWidget
{
	QTabWidget* obj = ObjectHelper<QTabWidget>::check( L, 1 );
	ObjectPeer::pushPeer( L, obj->widget( Util::toInt( L, 2 ) ), true );
	return 1;
}
コード例 #18
0
ファイル: cdrv.cpp プロジェクト: weigj/loongide
int drv_tabwidget(int drvid, void *a0, void* a1, void* a2, void* a3, void* a4, void* a5, void* a6, void* a7, void* a8, void* a9)
{
    handle_head* head = (handle_head*)a0;
    QTabWidget *self = (QTabWidget*)head->native;
    switch (drvid) {
    case TABWIDGET_INIT: {
        drvNewObj(a0,new QTabWidget);
        break;
    }
    case TABWIDGET_ADDTAB: {
        self->addTab(drvGetWidget(a1),drvGetString(a2));
        break;
    }
    case TABWIDGET_CLEAR: {
        self->clear();
        break;
    }
    case TABWIDGET_COUNT: {
        drvSetInt(a1,self->count());
        break;
    }
    case TABWIDGET_CURRENTINDEX: {
        drvSetInt(a1,self->currentIndex());
        break;
    }
    case TABWIDGET_CURRENTWIDGET: {
        drvSetHandle(a1,self->currentWidget());
        break;
    }
    case TABWIDGET_SETCURRENTINDEX: {
        self->setCurrentIndex(drvGetInt(a1));
        break;
    }
    case TABWIDGET_SETCURRENTWIDGET: {
        self->setCurrentWidget(drvGetWidget(a1));
        break;
    }
    case TABWIDGET_INDEXOF: {
        drvSetInt(a2,self->indexOf(drvGetWidget(a1)));
        break;
    }
    case TABWIDGET_INSERTTAB: {
        self->insertTab(drvGetInt(a1),drvGetWidget(a2),drvGetString(a3));
        break;
    }
    case TABWIDGET_REMOVETAB: {
        self->removeTab(drvGetInt(a1));
        break;
    }
    case TABWIDGET_SETTABTEXT: {
        self->setTabText(drvGetInt(a1),drvGetString(a2));
        break;
    }
    case TABWIDGET_SETTABTOOLTIP: {
        self->setTabToolTip(drvGetInt(a1),drvGetString(a2));
        break;
    }
    case TABWIDGET_TABTEXT: {
        drvSetString(a2,self->tabText(drvGetInt(a1)));
        break;
    }
    case TABWIDGET_TABTOOLTIP: {
        drvSetString(a2,self->tabToolTip(drvGetInt(a1)));
        break;
    }
    case TABWIDGET_WIDGETOF: {
        drvSetHandle(a2,self->widget(drvGetInt(a1)));
        break;
    }
    case TABWIDGET_ONCURRENTCHANGED: {
        QObject::connect(self,SIGNAL(currentChanged(int)),drvNewSignal(self,a1,a2),SLOT(call(int)));
        break;
    }
    default:
        return 0;
    }
    return 1;
}