当前位置: 首页>>代码示例>>C++>>正文


C++ QTabWidget::setTabPosition方法代码示例

本文整理汇总了C++中QTabWidget::setTabPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::setTabPosition方法的具体用法?C++ QTabWidget::setTabPosition怎么用?C++ QTabWidget::setTabPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTabWidget的用法示例。


在下文中一共展示了QTabWidget::setTabPosition方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QDockWidget

/**
Returns the pointer to the dock widget for the given dock area.

If dockwidget corresponding to the dock area is not found, new dockwidget for that
dock area is created.

\param area DockWidgetArea for which corresponding dockwidget is returned.

*/
QDockWidget* GCF::Components::MainWindow::dockWidget(Qt::DockWidgetArea area)
{
    QDockWidget* ret = 0;

    if(d->dockWidgetMap.contains(area))
        ret = d->dockWidgetMap[area];

    if(!ret)
    {
        // create the dock widget
        ret = new QDockWidget(this);
        ret->setAllowedAreas(area);
		ret->setFeatures(QDockWidget::NoDockWidgetFeatures);
		
		// This is to remove the title bar
		QWidget* titleWidget = new QWidget(this);
		ret->setTitleBarWidget( titleWidget );

        // place a tab widget on the dock widget
        QTabWidget* tabWidget = new QTabWidget(ret);
        ret->setWidget(tabWidget);

        // position the tabs in the right place.
        switch(area)
        {
        case Qt::LeftDockWidgetArea:
            tabWidget->setTabPosition(QTabWidget::North);
            break;
        case Qt::RightDockWidgetArea:
            tabWidget->setTabPosition(QTabWidget::North);
            break;
        case Qt::TopDockWidgetArea:
            tabWidget->setTabPosition(QTabWidget::North);
            // tabWidget->setFixedHeight(150);
            // ret->setFixedHeight(150);
            break;
        case Qt::BottomDockWidgetArea:
            tabWidget->setTabPosition(QTabWidget::North);
            // tabWidget->setFixedHeight(150);
            // ret->setFixedHeight(150);
            break;
        default:
            break;
        }
    }
	addDockWidget(area, ret);
    d->dockWidgetMap[area] = ret;
    ret->hide();
	

    return ret;
}
开发者ID:banduladh,项目名称:levelfour,代码行数:61,代码来源:MainWindow.cpp

示例2: setTabPosition

int TabWidget::setTabPosition ( lua_State * L ) //( TabPosition )void
{
	QTabWidget* obj = ObjectHelper<QTabWidget>::check( L, 1 );
	Enums enums(L);
	QTabWidget::TabPosition f =(QTabWidget::TabPosition)enums.TabPosition( 2 );
	obj->setTabPosition( f );
	return 0;
}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:8,代码来源:QtlTabWidget.cpp

示例3: CreateQtPartControl

void QmitkPythonView::CreateQtPartControl(QWidget* parent)
{
    d->m_PythonVariableStackTableView = new QmitkPythonVariableStackTableView;
    d->m_PythonVariableStackTableView->SetDataStorage(this->GetDataStorage());
    //d->m_PythonVariableStackTableView->horizontalHeader()->setResizeMode(QHeaderView::Interactive);

    QString snippetsFilePath = mitk::PluginActivator::m_XmlFilePath;
    MITK_DEBUG("QmitkPythonView") << "got snippetsFilePath " << snippetsFilePath.toStdString();

    d->m_PythonSnippets = new QmitkPythonSnippets(snippetsFilePath);

    MITK_DEBUG("QmitkPythonView") << "initializing varStackSnippetsTab";
    QTabWidget* varStackSnippetsTab = new QTabWidget;
    varStackSnippetsTab->addTab( d->m_PythonVariableStackTableView, "Variable Stack" );
    varStackSnippetsTab->addTab( d->m_PythonSnippets, "Snippets" );
    varStackSnippetsTab->setTabPosition( QTabWidget::South );

    MITK_DEBUG("QmitkPythonView") << "initializing m_PythonShell";
    d->m_PythonShell = new QmitkCtkPythonShell;

    MITK_DEBUG("QmitkPythonView") << "initializing m_TextEditor";
    d->m_TextEditor = new QmitkPythonTextEditor;

    MITK_DEBUG("QmitkPythonView") << "initializing tabWidgetConsoleEditor";
    QTabWidget* tabWidgetConsoleEditor = new QTabWidget;
    tabWidgetConsoleEditor->addTab( d->m_PythonShell, "Console" );
    tabWidgetConsoleEditor->addTab( d->m_TextEditor, "Text Editor" );
    tabWidgetConsoleEditor->setTabPosition( QTabWidget::South );

    QList<int> sizes;
    sizes << 1 << 3;
    QSplitter* splitter = new QSplitter;
    splitter->addWidget(varStackSnippetsTab);
    splitter->addWidget(tabWidgetConsoleEditor);
    splitter->setStretchFactor ( 0, 1 );
    splitter->setStretchFactor ( 1, 3 );

    QGridLayout* layout = new QGridLayout;
    layout->addWidget( splitter, 0, 0 );
    parent->setLayout(layout);

    MITK_DEBUG("QmitkPythonView") << "creating connections for m_PythonSnippets";
    connect( d->m_PythonSnippets, SIGNAL(PasteCommandRequested(QString)), d->m_PythonShell, SLOT(Paste(QString)) );
    connect( d->m_PythonSnippets, SIGNAL(PasteCommandRequested(QString)), d->m_TextEditor, SLOT(Paste(QString)) );
}
开发者ID:151706061,项目名称:MITK,代码行数:45,代码来源:QmitkPythonView.cpp

示例4: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    Widget w1;
    Widget w2;

    QTabWidget tabWidget;
    tabWidget.setTabPosition(QTabWidget::South);

    tabWidget.addTab(&w1, "Instance 1");
    tabWidget.addTab(&w2, "Instance 2");

    tabWidget.show();
    return a.exec();
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:16,代码来源:main.cpp

示例5: setTabPosition

void QTabWidgetProto::setTabPosition(int position)
{
  QTabWidget *item = qscriptvalue_cast<QTabWidget*>(thisObject());
  if (item)
    item->setTabPosition((QTabWidget::TabPosition)position);
}
开发者ID:,项目名称:,代码行数:6,代码来源:

示例6: QDialog

PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WFlags flags) :
    QDialog(parent, flags),
    m_audioDevice(0),
    m_changesOnRestart(false)
{
    setWindowTitle(tr("Sonic Visualiser: Application Preferences"));

    Preferences *prefs = Preferences::getInstance();

    QGridLayout *grid = new QGridLayout;
    setLayout(grid);

    QTabWidget *tab = new QTabWidget;
    grid->addWidget(tab, 0, 0);
    
    tab->setTabPosition(QTabWidget::North);

    // Create this first, as slots that get called from the ctor will
    // refer to it
    m_applyButton = new QPushButton(tr("Apply"));

    // Create all the preference widgets first, then create the
    // individual tab widgets and place the preferences in their
    // appropriate places in one go afterwards

    int min, max, deflt, i;

    m_windowType = WindowType(prefs->getPropertyRangeAndValue
                              ("Window Type", &min, &max, &deflt));
    m_windowTypeSelector = new WindowTypeSelector(m_windowType);

    connect(m_windowTypeSelector, SIGNAL(windowTypeChanged(WindowType)),
            this, SLOT(windowTypeChanged(WindowType)));

    QComboBox *smoothing = new QComboBox;
    
    int sm = prefs->getPropertyRangeAndValue("Spectrogram Y Smoothing", &min, &max,
                                             &deflt);
    m_spectrogramSmoothing = sm;

    for (i = min; i <= max; ++i) {
        smoothing->addItem(prefs->getPropertyValueLabel("Spectrogram Y Smoothing", i));
    }

    smoothing->setCurrentIndex(sm);

    connect(smoothing, SIGNAL(currentIndexChanged(int)),
            this, SLOT(spectrogramSmoothingChanged(int)));

    QComboBox *xsmoothing = new QComboBox;
    
    int xsm = prefs->getPropertyRangeAndValue("Spectrogram X Smoothing", &min, &max,
                                             &deflt);
    m_spectrogramXSmoothing = xsm;

    for (i = min; i <= max; ++i) {
        xsmoothing->addItem(prefs->getPropertyValueLabel("Spectrogram X Smoothing", i));
    }

    xsmoothing->setCurrentIndex(xsm);

    connect(xsmoothing, SIGNAL(currentIndexChanged(int)),
            this, SLOT(spectrogramXSmoothingChanged(int)));

    QComboBox *propertyLayout = new QComboBox;
    int pl = prefs->getPropertyRangeAndValue("Property Box Layout", &min, &max,
                                         &deflt);
    m_propertyLayout = pl;

    for (i = min; i <= max; ++i) {
        propertyLayout->addItem(prefs->getPropertyValueLabel("Property Box Layout", i));
    }

    propertyLayout->setCurrentIndex(pl);

    connect(propertyLayout, SIGNAL(currentIndexChanged(int)),
            this, SLOT(propertyLayoutChanged(int)));

    m_tuningFrequency = prefs->getTuningFrequency();

    QDoubleSpinBox *frequency = new QDoubleSpinBox;
    frequency->setMinimum(100.0);
    frequency->setMaximum(5000.0);
    frequency->setSuffix(" Hz");
    frequency->setSingleStep(1);
    frequency->setValue(m_tuningFrequency);
    frequency->setDecimals(2);

    connect(frequency, SIGNAL(valueChanged(double)),
            this, SLOT(tuningFrequencyChanged(double)));

    QComboBox *audioDevice = new QComboBox;
    std::vector<QString> devices =
        AudioTargetFactory::getInstance()->getCallbackTargetNames();
    
    QSettings settings;
    settings.beginGroup("Preferences");
    QString targetName = settings.value("audio-target", "").toString();
    settings.endGroup();

//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


注:本文中的QTabWidget::setTabPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。