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


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

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


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

示例1: QMainWindow

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
    QMenu *file;
    QMenu *edit;
    QMenu *effect;
    QMenu *tools;
    QMenu *help;
    QAction *newa = new QAction(tr("&New"), this);
    QAction *open = new QAction(tr("&Open"), this);
    QAction *save = new QAction(tr("&Save"), this);
    QAction *saveas = new QAction(tr("&Save as"), this);
    QAction *import = new QAction(tr("&Import sample"), this);
    QAction *quit = new QAction(tr("&Quit"), this);
    QAction *play = new QAction(tr("&Play"), this);
    QAction *stop = new QAction(tr("&Stop"), this);
    QAction *pause = new QAction(tr("&Pause"), this);
    QAction *record= new QAction(tr("&Record"), this);
    QAction *zoomin  = new QAction(tr("Zoom in"), this);
    QAction *zoomout = new QAction(tr("Zoom out"), this);
    QAction *settings = new QAction(tr("&Settings"), this);
    QToolBar *toolbar = addToolBar("Main ToolBar");
    QLCDNumber *lcd = new QLCDNumber();
    QLabel * play_v = new QLabel(), * rec_v = new QLabel();
    QSlider * play_slider = new QSlider(Qt::Horizontal), * rec_slider = new QSlider(Qt::Horizontal);
    wave = new Wave();
    fileName = "";
    changed = false;
    newa->setIcon(QIcon::fromTheme("document-new"));
    newa->setShortcut(tr("CTRL+N"));
    open->setIcon(QIcon::fromTheme("document-open"));
    open->setShortcut(tr("CTRL+O"));
    save->setIcon(QIcon::fromTheme("document-save"));
    save->setShortcut(tr("CTRL+S"));
    saveas->setIcon(QIcon::fromTheme("document-save-as"));
    import->setIcon(QIcon::fromTheme("audio-x-generic"));
    zoomin->setIcon(QIcon::fromTheme("zoom-in"));
    zoomin->setShortcut(tr("CTRL+Up"));
    zoomout->setIcon(QIcon::fromTheme("zoom-out"));
    zoomout->setShortcut(tr("CTRL+Down"));
    play->setIcon(QIcon::fromTheme("media-playback-start"));
    play->setShortcut(tr("Space"));
    play->setCheckable(true);
    stop->setIcon(QIcon::fromTheme("media-playback-stop"));
    pause->setIcon(QIcon::fromTheme("media-playback-pause"));
    record->setIcon(QIcon::fromTheme("media-record"));
    record->setShortcut(tr("Ctrl+Space"));
    record->setCheckable(true);
    quit->setIcon(QIcon::fromTheme("application-exit"));
    quit->setShortcut(tr("CTRL+Q"));
    lcd->setDigitCount(8);
    lcd->display("00:00:00");
    lcd->setStyleSheet("background: black; color: #00FF00");
    lcd->setFixedSize(100, 30);
    play_v->setText(tr("Playback volume:"));
    rec_v->setText(tr("Record volume:"));
    play_slider->setMaximumWidth(50);
    play_slider->setRange(0, 100);
    rec_slider->setMaximumWidth(50);
    rec_slider->setRange(0, 100);
    file = menuBar()->addMenu(tr("&File"));
    file->addAction(newa);
    file->addAction(open);
    file->addAction(save);
    file->addAction(saveas);
    file->addSeparator();
    file->addAction(import);
    file->addSeparator();
    file->addAction(quit);
    edit = menuBar()->addMenu(tr("&Edit"));
    effect = menuBar()->addMenu(tr("&Effects"));
    tools = menuBar()->addMenu(tr("&Tools"));
    settings->setIcon(QIcon::fromTheme("multimedia-volume-control"));
    tools->addAction(settings);
    help = menuBar()->addMenu(tr("&Help"));

    toolbar->addAction(newa);
    toolbar->addAction(open);
    toolbar->addAction(save);
    toolbar->addSeparator();
    toolbar->addAction(import);
    toolbar->addAction(zoomin);
    toolbar->addAction(zoomout);
    toolbar->addSeparator();
    toolbar->addAction(stop);
    toolbar->addAction(pause);
    toolbar->addAction(play);
    toolbar->addAction(record);
    toolbar->addSeparator();
    toolbar->addWidget(play_v);
    toolbar->addWidget(play_slider);
    toolbar->addWidget(rec_v);
    toolbar->addWidget(rec_slider);
    toolbar->addWidget(lcd);
    connect(newa, SIGNAL(triggered()), this, SLOT(newFile()));
    connect(open, SIGNAL(triggered()), this, SLOT(openFile()));
    connect(save, SIGNAL(triggered()), this, SLOT(saveFile()));
    connect(saveas, SIGNAL(triggered()), this, SLOT(saveFileAs()));
    connect(quit, SIGNAL(triggered()), qApp, SLOT(quit()));

    connect(zoomin, SIGNAL(triggered()), this, SLOT(zoomIn()));
//.........这里部分代码省略.........
开发者ID:hzoli17,项目名称:ZSFEdit,代码行数:101,代码来源:mainwindow.cpp


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