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


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

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


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

示例1: constructWindow

void mixer_main::constructWindow()
{

    Controller *contP = &controller;
    QDesktopWidget *desktop = new QDesktopWidget();
    QRect screen = desktop->availableGeometry(this);
    this->setFixedSize(screen.width(),screen.height()-50);

    //Tab Object
    QTabWidget *tabs = new QTabWidget(this);
    tabs->setMinimumSize(screen.width(), screen.height()-50);
    tabs->setStyleSheet("QTabBar::tab { background: white; border: 2px solid black; } QTabBar::tab:selected { background: qlineargradient(x1: 0, y1: 1, x2: 0, y2: 0,"
                        "stop: 0 #FF0000, stop: 0.8 #FFFFFF); }");


    //Widgets used as frames for Scroll Areas
    QWidget *main1 = new QWidget();
    QWidget *main2 = new QWidget();
    QWidget *main3 = new QWidget();
    QWidget *main4 = new QWidget();

    //Mixer Objects
    mix1 = new Mixer(0, 26, contP);
    mix2 = new Mixer(1, 28, contP);
    mix3 = new Mixer(2, 30, contP);
    mix4 = new Mixer(3, 32, contP);


    //Scroll Area Objects
    QFingerScrollArea *mix1slide = new QFingerScrollArea(main1);
    QFingerScrollArea *mix2slide = new QFingerScrollArea(main2);
    QFingerScrollArea *mix3slide = new QFingerScrollArea(main3);
    QFingerScrollArea *mix4slide = new QFingerScrollArea(main4);


    //Setting Scroll Area targets and size
    mix1slide->setWidget(mix1);
    mix2slide->setWidget(mix2);
    mix3slide->setWidget(mix3);
    mix4slide->setWidget(mix4);
    mix1slide->setMinimumSize(screen.width()-30, screen.height()-30);
    mix2slide->setMinimumSize(screen.width()-30, screen.height()-30);
    mix3slide->setMinimumSize(screen.width()-30, screen.height()-30);
    mix4slide->setMinimumSize(screen.width()-30, screen.height()-30);

    //Show Scroll Areas
    mix1slide->show();
    mix2slide->show();
    mix3slide->show();
    mix4slide->show();

    //Add Frames to tab object
    tabs->addTab(main1, "Mix 1");
    tabs->addTab(main2, "Mix 2");
    tabs->addTab(main3, "Mix 3");
    tabs->addTab(main4, "Mix 4");

    connect(tabs,SIGNAL(currentChanged(int)),this,SLOT(saveAndLoadArray(int)));

}
开发者ID:benwellard,项目名称:Mixer,代码行数:60,代码来源:mixer_main.cpp

示例2: QTabWidget

QWidget * Tabs::createQtWidget(Proxy *proxy, UIProxy *uiproxy, QWidget *parent)
{
    QTabWidget *tabwidget = new QTabWidget(parent);
    tabwidget->setEnabled(enabled);
    tabwidget->setVisible(visible);
    tabwidget->setStyleSheet(QString::fromStdString(style));
    for(std::vector<Tab*>::const_iterator it = tabs.begin(); it != tabs.end(); ++it)
    {
        QWidget *tab = (*it)->createQtWidget(proxy, uiproxy, tabwidget);
        tabwidget->addTab(tab, QString::fromStdString((*it)->title));
    }
    setQWidget(tabwidget);
    setProxy(proxy);
    return tabwidget;
}
开发者ID:fferri,项目名称:v_repExtCustomUI,代码行数:15,代码来源:Tabs.cpp

示例3: flagMask

GuiPanel::GuiPanel(QWidget *parent, IniData &id) :
    QWidget(parent),
    inidata(id),
    ui(new Ui::GuiPanel)
{
  reference = NULL;
  curMaterialFocus = DIFFUSEA;

  //mapMT = mm;
  _selectedIndex = -1;

  ui->setupUi(this);

//  ui->attributeData->tabBar()->setContentsMargins(-4,0,-4,0);
  QTabWidget *tw = ui->attributeData;
  int mar = 0;
  tw->setStyleSheet(QString("QTabBar::tab { width: %1px;padding-top: 1px; padding-bottom: 1px;margin-right: %2px;margin-left: %2px;} ")
                    .arg((tw->size().width()+(2*mar*tw->count())-1)/tw->count()).arg(-mar)
                    );

  ui->wiBodyAxisA->setVisible(false);
  ui->wiBodyAxisB->setVisible(false);
  ui->wiBodyRadius->setVisible(false);
  ui->wiBodyNFaces->setVisible(false);
  ui->wiBodyNVerts->setVisible(false);
  ui->wiBodySigns->setVisible(false);
  ui->wiBodyFlags->setVisible(false);

  ui->bodyData->setVisible(false);
  ui->meshData->setVisible(false);
  ui->textureData->setVisible(false);
  ui->animationData->setVisible(false);
  ui->materialData->setVisible(false);
  ui->skeletonData->setVisible(false);
  ui->shaderData->setVisible(false);
  ui->hitboxEdit->setVisible(false);

  ui->viewRuler->setVisible(false);
  ui->viewFloatingProbe->setVisible(false);
  ui->generalView->setVisible(false);
  ui->vertexData->setVisible(false);


  ui->lvTextAcc->setModel( new TextureAccessModel(this) );
  ui->lvBodyPart->setModel( new BodyPartModel(this) );
  ui->lvBones->setModel( new BodyPartModel(this) );


  //ui->frameNumber->setBackgroundRole(QPalette::Foreground);
  //ui->frameNumberAni->setBackgroundRole(QPalette::Foreground);

  alignY(ui->textureData  ,ui->meshData);
  alignY(ui->materialData  ,ui->meshData);
  alignY(ui->animationData,ui->meshData);
  alignY(ui->skeletonData,ui->meshData);
  alignY(ui->shaderData,  ui->meshData);
  alignY(ui->bodyData,  ui->meshData);

  alignYAfter(ui->hitboxEdit, ui->skeletonData);
  alignY(ui->vertexData,  ui->meshData);
  //alignYAfter(ui->vertexData , ui->meshData );

  QString flagMask(">Hhhhhhhh");
  ui->boxFlags->setInputMask(flagMask);
  ui->boxTextureFlags->setInputMask(flagMask);
  ui->leMatFlags->setInputMask(flagMask);
  ui->leShaderFlags->setInputMask(flagMask);
  ui->leShaderTaFlags->setInputMask(flagMask);
  ui->leBodyFlags->setInputMask(flagMask);
  ui->leShaderRequires->setInputMask(flagMask);

  skel = NULL;

  //ui->leMatR->setInputMask("0.0000");
  //ui->leMatG->setInputMask("0.0000");
  //ui->leMatB->setInputMask("0.0000");
  //ui->leMatCoeff->setInputMask("0000");
  //ui->timeOfFrame->setInputMask("0000");

  textureAccessDup = new QAction("Duplicate",this);
  textureAccessDel = new QAction("Remove",this);
  textureAccessAdd = new QAction("Add",this);

  bodyPartDup = new QAction("Duplicate",this);
  bodyPartDel = new QAction("Remove",this);
  bodyPartAdd = new QAction("Add",this);

  connect(ui->cbSkin, SIGNAL(currentIndexChanged(QString)), this, SLOT(updateVisibility()));
  connect(ui->cbRefani, SIGNAL(currentIndexChanged(QString)), this, SLOT(updateVisibility()));
  connect(ui->cbRuler, SIGNAL(stateChanged(int)), this, SLOT(updateVisibility()));
  connect(ui->cbRefani, SIGNAL(currentIndexChanged(QString)), this, SLOT(updateRefAnimation()));

  connect(ui->rulerSlid, SIGNAL(sliderMoved (int)), this, SLOT(setRulerLenght(int)));
  connect(ui->rulerSpin, SIGNAL(valueChanged(int)), this, SLOT(setRulerLenght(int)));

  connect(ui->lvTextAcc->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
          this, SLOT(updateShaderTextaccData()));
  connect(ui->lvBodyPart->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
          this, SLOT(updateBodyPartData()));
  connect(ui->lvBones->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
//.........这里部分代码省略.........
开发者ID:cfcohen,项目名称:openbrf,代码行数:101,代码来源:guipanel.cpp


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