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


C++ PaletteScrollArea::setFocusPolicy方法代码示例

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


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

示例1: boxClicked

DrumTools::DrumTools(QWidget* parent)
   : QDockWidget(parent)
      {
      drumset = 0;
      _score  = 0;
      setObjectName("drum-tools");
      setAllowedAreas(Qt::DockWidgetAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea));

      QWidget* w = new QWidget(this);
      w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
      w->setMaximumHeight(100);
      QHBoxLayout* layout = new QHBoxLayout;
      w->setLayout(layout);

      QVBoxLayout* layout1 = new QVBoxLayout;
      layout1->setSpacing(6);
      pitchName = new QLabel;
      pitchName->setAlignment(Qt::AlignCenter);
      pitchName->setWordWrap(true);
      pitchName->setContentsMargins(25, 0, 25, 0);
      layout1->addWidget(pitchName);
      QHBoxLayout* buttonLayout = new QHBoxLayout;
      buttonLayout->setContentsMargins(25, 10, 25, 10);
      editButton = new QToolButton;
      editButton->setMinimumWidth(100);
      editButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
      buttonLayout->addWidget(editButton);
      layout1->addLayout(buttonLayout);
      layout->addLayout(layout1);

      drumPalette = new Palette;
      drumPalette->setMag(0.8);
      drumPalette->setSelectable(true);
      drumPalette->setGrid(28, 60);
      PaletteScrollArea* sa = new PaletteScrollArea(drumPalette);
      sa->setFocusPolicy(Qt::NoFocus);
      layout->addWidget(sa);

      setWidget(w);

      w = new QWidget(this);
      setTitleBarWidget(w);
      titleBarWidget()->hide();
      connect(editButton, SIGNAL(clicked()), SLOT(editDrumset()));
      void boxClicked(int);
      connect(drumPalette, SIGNAL(boxClicked(int)), SLOT(drumNoteSelected(int)));
      retranslate();
      drumPalette->setContextMenuPolicy(Qt::PreventContextMenu);
      }
开发者ID:IsaacWeiss,项目名称:MuseScore,代码行数:49,代码来源:drumtools.cpp

示例2: boxClicked

DrumTools::DrumTools(QWidget* parent)
   : QDockWidget(parent)
      {
      drumset = 0;
      _score  = 0;
      setObjectName("drum-tools");
      setWindowTitle(tr("Drum Tools"));
      setAllowedAreas(Qt::DockWidgetAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea));

      QWidget* w = new QWidget(this);
      w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
      QHBoxLayout* layout = new QHBoxLayout;
      w->setLayout(layout);

      QVBoxLayout* layout1 = new QVBoxLayout;
      QToolButton* tb = new QToolButton;
      tb->setText(tr("Edit Drumset"));
      layout1->addWidget(tb);
      layout1->addStretch();
      layout->addLayout(layout1);

      drumPalette = new Palette;
      drumPalette->setName(tr("Drums"));
      drumPalette->setMag(0.8);
      drumPalette->setSelectable(true);
      drumPalette->setGrid(28, 60);
      PaletteScrollArea* sa = new PaletteScrollArea(drumPalette);
      sa->setFocusPolicy(Qt::NoFocus);
      layout->addWidget(sa);

      setWidget(w);
//      setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));

      w = new QWidget(this);
      setTitleBarWidget(w);
      titleBarWidget()->hide();
      connect(tb, SIGNAL(clicked()), SLOT(editDrumset()));
      void boxClicked(int);
      connect(drumPalette, SIGNAL(boxClicked(int)), SLOT(drumNoteSelected(int)));
      }
开发者ID:HerbertYu,项目名称:MuseScore,代码行数:40,代码来源:drumtools.cpp


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