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


C++ QTabBar::setVisible方法代码示例

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


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

示例1: applyTabPosition

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void Scheme::applyTabPosition(QTabWidget *tab) {
	QTabBar *tabBar = tab->findChild<QTabBar*>();

	if ( tabPosition > 0 ) {
		tab->setTabPosition(static_cast<QTabWidget::TabPosition>(tabPosition-1));
		if ( tabBar )
			tabBar->setVisible(true);
	}
	else if ( tabPosition == 0 ) {
		if ( tabBar )
			tabBar->setVisible(false);
	}
}
开发者ID:marcelobianchi,项目名称:seiscomp3,代码行数:14,代码来源:scheme.cpp

示例2: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    core(new QRCore()),
    ui(new Ui::MainWindow),
    webserverThread(core, this)
{
    ui->setupUi(this);

    doLock = false;

    // Add custom font
    QFontDatabase::addApplicationFont(":/new/prefix1/fonts/Anonymous Pro.ttf");

    /*
    * Toolbar
    */
    // Hide central tab widget tabs
    QTabBar *centralbar = ui->centralTabWidget->tabBar();
    centralbar->setVisible(false);
    // Adjust console lineedit
    ui->consoleInputLineEdit->setTextMargins(10, 0, 0, 0);
    /*
    ui->consoleOutputTextEdit->setFont(QFont("Monospace", 8));
    ui->consoleOutputTextEdit->setStyleSheet("background-color:black;color:gray;");
    ui->consoleInputLineEdit->setStyleSheet("background-color:black;color:gray;");
    */

    // Adjust text margins of consoleOutputTextEdit
    QTextDocument *console_docu = ui->consoleOutputTextEdit->document();
    console_docu->setDocumentMargin(10);

    // Sepparator between back/forward and undo/redo buttons
    QWidget* spacer4 = new QWidget();
    spacer4->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
    spacer4->setMinimumSize(10, 10);
    ui->mainToolBar->insertWidget(ui->actionForward, spacer4);

    // Popup menu on theme toolbar button
    QToolButton *backButton = new QToolButton(this);
    backButton->setIcon(QIcon(":/new/prefix1/img/icons/arrow_left.png"));
    //backButton->setPopupMode(QToolButton::DelayedPopup);
    ui->mainToolBar->insertWidget(ui->actionForward, backButton);
    connect(backButton, SIGNAL(clicked()), this, SLOT(on_backButton_clicked()));

    // Sepparator between undo/redo and goto lineEdit
    QWidget* spacer3 = new QWidget();
    spacer3->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    spacer3->setMinimumSize(20, 20);
    spacer3->setMaximumWidth(300);
    ui->mainToolBar->insertWidget(ui->actionShow_Hide_mainsidebar, spacer3);

    // Omnibar LineEdit
    this->omnibar = new Omnibar(this);
    ui->mainToolBar->insertWidget(ui->actionShow_Hide_mainsidebar, this->omnibar);

    // Add special sepparators to the toolbar that expand to separate groups of elements
    QWidget* spacer2 = new QWidget();
    spacer2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    spacer2->setMinimumSize(10, 10);
    spacer2->setMaximumWidth(300);
    ui->mainToolBar->insertWidget(ui->actionShow_Hide_mainsidebar, spacer2);

    // Sepparator between back/forward and undo/redo buttons
    QWidget* spacer = new QWidget();
    spacer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
    spacer->setMinimumSize(20, 20);
    ui->mainToolBar->addWidget(spacer);

    // codeGraphics tool bar
    this->graphicsBar = new GraphicsBar(this);
    this->graphicsBar->setMovable(false);
    addToolBarBreak(Qt::TopToolBarArea);
    addToolBar(graphicsBar);

    // Fix output panel font
    QHelpers *help = new QHelpers();
    help->normalizeFont(ui->consoleOutputTextEdit);

    /*
     * Dock Widgets
     */

    // Add Memory DockWidget
    this->memoryDock = new MemoryWidget(this);
    this->dockList << this->memoryDock;
    // To use in the future when we handle more than one memory views
    // this->memoryDock->setAttribute(Qt::WA_DeleteOnClose);
    // this->add_debug_output( QString::number(this->dockList.length()) );

    // Add Sections dock panel
    this->sectionsWidget = new SectionsWidget(this);
    this->sectionsDock = new QDockWidget("Sections");
    this->sectionsDock->setObjectName("sectionsDock");
    this->sectionsDock->setAllowedAreas(Qt::AllDockWidgetAreas);
    this->sectionsDock->setWidget(this->sectionsWidget);
    this->sectionsWidget->setContentsMargins(0,0,0,5);
    this->sectionsDock->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    this->sectionsDock->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this->sectionsDock, SIGNAL(customContextMenuRequested(const QPoint &)),
            this, SLOT(showSectionsContextMenu(const QPoint &)));
//.........这里部分代码省略.........
开发者ID:probonopd,项目名称:iaito,代码行数:101,代码来源:mainwindow.cpp


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