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


C++ QToolBar::setProperty方法代码示例

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


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

示例1: QToolBar

ToolBox::ToolBox(QWidget *parentWidget)
    : Utils::StyledBar(parentWidget),
  m_leftToolBar(new QToolBar(QLatin1String("LeftSidebar"), this)),
  m_rightToolBar(new QToolBar(QLatin1String("RightSidebar"), this))
{
    setMaximumHeight(22);
    m_leftToolBar->setFloatable(true);
    m_leftToolBar->setMovable(true);
    m_leftToolBar->setOrientation(Qt::Horizontal);
    m_leftToolBar->setIconSize(QSize(24, 24));

    QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
    horizontalLayout->setMargin(0);
    horizontalLayout->setSpacing(0);

    QToolBar *stretchToolbar = new QToolBar(this);

    m_leftToolBar->setProperty("panelwidget", true);
    m_leftToolBar->setProperty("panelwidget_singlerow", false);

    m_rightToolBar->setProperty("panelwidget", true);
    m_rightToolBar->setProperty("panelwidget_singlerow", false);

    stretchToolbar->setProperty("panelwidget", true);
    stretchToolbar->setProperty("panelwidget_singlerow", false);

    stretchToolbar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);

    m_rightToolBar->setOrientation(Qt::Horizontal);
    m_rightToolBar->setIconSize(QSize(24, 24));
    horizontalLayout->addWidget(m_leftToolBar);
    horizontalLayout->addWidget(stretchToolbar);
    horizontalLayout->addWidget(m_rightToolBar);
}
开发者ID:aheubusch,项目名称:qt-creator,代码行数:34,代码来源:toolbox.cpp

示例2: QToolBar

ToolBox::ToolBox(QWidget *parentWidget)
    : Utils::StyledBar(parentWidget),
  m_leftToolBar(new QToolBar("LeftSidebar", this)),
  m_rightToolBar(new QToolBar("RightSidebar", this))
{
    setMaximumHeight(44);
    setSingleRow(false);
    QFrame *frame = new QFrame(this);
    m_crumblePath = new Utils::CrumblePath(frame);
    frame->setStyleSheet("background-color: #4e4e4e;");
    frame->setFrameShape(QFrame::NoFrame);
    QHBoxLayout *layout = new QHBoxLayout(frame);
    layout->setMargin(0);
    layout->setSpacing(0);
    frame->setLayout(layout);
    layout->addWidget(m_crumblePath);
    frame->setProperty("panelwidget", true);
    frame->setProperty("panelwidget_singlerow", false);
    QVBoxLayout *verticalLayout = new QVBoxLayout(this);
    verticalLayout->setMargin(0);
    verticalLayout->setSpacing(0);

    QHBoxLayout *horizontalLayout = new QHBoxLayout();
    verticalLayout->addLayout(horizontalLayout);
    verticalLayout->addWidget(frame);
    horizontalLayout->setMargin(0);
    horizontalLayout->setSpacing(0);

    m_leftToolBar->setFloatable(true);
    m_leftToolBar->setMovable(true);
    m_leftToolBar->setOrientation(Qt::Horizontal);
    m_leftToolBar->setIconSize(QSize(24, 24));

    QToolBar *stretchToolbar = new QToolBar(this);

    setSingleRow(false);

    m_leftToolBar->setProperty("panelwidget", true);
    m_leftToolBar->setProperty("panelwidget_singlerow", false);

    m_rightToolBar->setProperty("panelwidget", true);
    m_rightToolBar->setProperty("panelwidget_singlerow", false);

    stretchToolbar->setProperty("panelwidget", true);
    stretchToolbar->setProperty("panelwidget_singlerow", false);

    stretchToolbar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);

    m_rightToolBar->setOrientation(Qt::Horizontal);
    m_rightToolBar->setIconSize(QSize(24, 24));
    horizontalLayout->addWidget(m_leftToolBar);
    horizontalLayout->addWidget(stretchToolbar);
    horizontalLayout->addWidget(m_rightToolBar);
}
开发者ID:KDE,项目名称:android-qt-creator,代码行数:54,代码来源:toolbox.cpp

示例3: IPlayerWidget

PlayerWidget::PlayerWidget(QWidget *parent) :
    IPlayerWidget(parent), ui(new Ui::PlayerWidget), playbackController(Core::ICore::playbackController())
{
    ui->setupUi(this);

    QFile file;
    file.setFileName(":/style/ressources/stylesheet.css");
    file.open(QFile::ReadOnly);
    QString styleSheet = QLatin1String(file.readAll());
    this->setStyleSheet(styleSheet);

    QPalette palette;
    palette.setBrush(QPalette::WindowText, Qt::white);

    ui->info->setStyleSheet("border-image:url(:images/ressources/display.png) ; border-width:3px");
    ui->info->setPalette(palette);
    ui->info->setText(tr("<center>No media</center>"));

    ui->info->setMargin(2);
    ui->info->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
    ui->info->setLineWidth(2);
    ui->info->setAutoFillBackground(true);

    QToolBar *toolBar = new QToolBar(this);
    ui->sliderToolbarLayout->addWidget(toolBar);
    toolBar->setProperty("type","playerControls");
    toolBar->setStyleSheet("QToolBar{border:none;}");

    toolBar->addAction(playbackController->previousAction());
    toolBar->addAction(playbackController->playPauseAction());
    toolBar->addAction(playbackController->stopAction());
    toolBar->addAction(playbackController->nextAction());

    connect(playbackController, SIGNAL(mediaChanged(Core::Media*)), this, SLOT(mediaChanged(Core::Media*)));
    connect(playbackController, SIGNAL(update(int)), this, SLOT(update(int)));

    ui->volumeSlider->setValue(100);
    this->setMaximumHeight(100);
    this->setMinimumHeight(100);
}
开发者ID:safri-framework,项目名称:safri-player,代码行数:40,代码来源:playerwidget.cpp


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