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


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

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


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

示例1: setTabCaptions

void MainWindow::setTabCaptions()
{
    QTabBar* bar = ui->tabWidget->tabBar();

    short tabCount = this->tabCaptions.length();
    for (int x = 0; x < tabCount; ++x)
    {
        this->setTabCaption(x, this->tabCaptions.at(x));

        if (this->logCount.at(x) > 0)
            bar->setTabTextColor(x, QColor(0, 0, 0));
        else bar->setTabTextColor(x, QColor(180, 180, 180));
    }
}
开发者ID:koas,项目名称:maurina,代码行数:14,代码来源:MainWindow.cpp

示例2: gameProcessFinished

void MainWindow::gameProcessFinished(GameProcess* process, int ) {
    //ui->tabWidget->fi
    int index = ui->tabWidget->indexOf(process);
    //ui->tabWidget->setTabText(index, "");

    if (index < 1)
        return;

    QTabBar* bar = ui->tabWidget->tabBar();
    bar->setTabTextColor(index, Qt::red);
}
开发者ID:jwmclean,项目名称:Launchpad,代码行数:11,代码来源:mainwindow.cpp

示例3: displayText

void chatRoom::displayText(Message *m, int index) {
    QMap<int, User*>::iterator it;
    it = global->find(m->getFrom());
    QString username;
    User *user = it.value();
    if(it == global->end()) {
        username.append("not yet connected");
    }
    else {
        username.append(user->getUsername());
    }
    qDebug() << m->getFrom();
    QString mText(m->getBuffer());
    if(roomID != 0) {
        QTabBar *tabBar = tab->tabBar();
        if(tabID != index) {
            tabBar->setTabTextColor(m->getDest(), Qt::red);
        }
    }
    //display->setStyleSheet("font: 9pt \"Courier\";");
    display->appendPlainText(username + ": " + mText);
}
开发者ID:Ernyoke,项目名称:TCP-Chat-Client,代码行数:22,代码来源:chatroom.cpp

示例4: startSWG


//.........这里部分代码省略.........
/*
    arguments.append("--");
    arguments.append("-s");
    arguments.append("SharedFoundation");
    arguments.append("minFrameRate=60");
*/
  //  QFile executable()
/*
    arguments.append("--");
    arguments.append("-s");
    arguments.append("ClientTerrain");
    arguments.append("dynamicNearFloraDistance=128");

    arguments.append("--");
    arguments.append("-s");
    arguments.append("ClientTerrain");
    arguments.append("staticNonCollidableFloraDistance=2048");

    arguments.append("--");
    arguments.append("-s");
    arguments.append("ClientProceduralTerrainAppearance_LevelOfDetail");
    arguments.append("forceHighThreshold=40");

    arguments.append("--");
    arguments.append("-s");
    arguments.append("ClientProceduralTerrainAppearance_LevelOfDetail");
    arguments.append("threshold=40");

    arguments.append("--");
    arguments.append("-s");
    arguments.append("ClientProceduralTerrainAppearance_LevelOfDetail");
    arguments.append("heightBiasMax=4096");
*/
    //ClientProceduralTerrainAppearance_LevelOfDetail.heightBiasMax



    //ClientGame.cameraFarPlane

    /*ClientProceduralTerrainAppearance_LevelOfDetail.threshold*/


    /*ClientProceduralTerrainAppearance_LevelOfDetail.forceHighThreshold*/


    arguments.append("--");
    arguments.append("-s");
    arguments.append("ClientGame");

    if (server != NULL)
        arguments.append("loginServerAddress0=" + server->getHost());
    else
        arguments.append("loginServerAddress0=" + LoginServers::defaultLoginAddress);

    if (server == NULL)
        arguments.append("loginServerPort0=" + QString::number(LoginServers::defaultLoginPort));
    else
        arguments.append("loginServerPort0=" + QString::number(server->getPort()));

    arguments.append("-s");
    arguments.append("Station");
    arguments.append("gameFeatures=34929");

    if (multiple) {
        if (parser->hasConfigValue("SwgClient", "allowMultipleInstances")) {
            bool val = parser->getBooleanConfigValue("SwgClient", "allowMultipleInstances");

            if (!val) {
                QMessageBox::warning(this, "Warning", "You selected the multiple instances option but you have set it to false in the swg config files!");
            }
        }

        arguments.append("-s");
        arguments.append("SwgClient");
        arguments.append("allowMultipleInstances=true");
    }

    qDebug() << "start swg with arguments " << arguments;

    connect(process, SIGNAL(processFinished(GameProcess*,int)), this, SLOT(gameProcessFinished(GameProcess*,int)));

    ui->tabWidget->addTab(process, "Process " + QString::number(++gameProcessesCount));
    gameProcesses.append(process);
    QTabBar* bar = ui->tabWidget->tabBar();
    int tabIndex = ui->tabWidget->indexOf(process);
    bar->setTabTextColor(tabIndex, Qt::green);
    bar->setTabIcon(tabIndex, QIcon(":/img/tab.svg"));

    //process->show();
    bool startResult = process->start(folder, gameExecutable, arguments);

    if (startResult) {
        //showMinimized();
        if (settings.value("minimize_after_start", false).toBool()) {
            systemTrayIcon->show();

            QTimer::singleShot(0, this, SLOT(hide()));
        }
    }
}
开发者ID:jwmclean,项目名称:Launchpad,代码行数:101,代码来源:mainwindow.cpp


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