本文整理汇总了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);
}
示例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)));
}