本文整理汇总了C++中SyncDocument::getTrackCount方法的典型用法代码示例。如果您正苦于以下问题:C++ SyncDocument::getTrackCount方法的具体用法?C++ SyncDocument::getTrackCount怎么用?C++ SyncDocument::getTrackCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SyncDocument
的用法示例。
在下文中一共展示了SyncDocument::getTrackCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyPressEvent
void TrackView::keyPressEvent(QKeyEvent *event)
{
SyncDocument *doc = getDocument();
if (!readOnly && lineEdit->isVisible()) {
switch (event->key()) {
case Qt::Key_Up:
case Qt::Key_Down:
case Qt::Key_Left:
case Qt::Key_Right:
case Qt::Key_PageUp:
case Qt::Key_PageDown:
case Qt::Key_Home:
case Qt::Key_End:
case Qt::Key_Space:
editEnterValue();
return;
}
}
bool shiftDown = (event->modifiers() & Qt::ShiftModifier) != 0;
bool ctrlDown = (event->modifiers() & Qt::ControlModifier) != 0;
bool selecting = shiftDown;
if (lineEdit->isHidden()) {
switch (event->key()) {
case Qt::Key_Backtab:
if (ctrlDown) {
// the main window will handle this
event->ignore();
return;
}
selecting = false;
// FALLTHROUGH
case Qt::Key_Left:
if (ctrlDown) {
if (0 < editTrack)
page->swapTrackOrder(editTrack, editTrack - 1);
else
QApplication::beep();
}
if (0 != getTrackCount())
setEditTrack(editTrack - 1, selecting);
else
QApplication::beep();
return;
case Qt::Key_Tab:
if (ctrlDown) {
// the main window will handle this
event->ignore();
return;
}
selecting = false;
// FALLTHROUGH
case Qt::Key_Right:
if (ctrlDown) {
if (getTrackCount() > editTrack + 1)
page->swapTrackOrder(editTrack, editTrack + 1);
else
QApplication::beep();
}
if (0 != getTrackCount())
setEditTrack(editTrack + 1, selecting);
else
QApplication::beep();
return;
}
}
if (lineEdit->isHidden()) {
if (!readOnly && ctrlDown) {
switch (event->key()) {
case Qt::Key_Up:
if (getTrackCount() > editTrack)
editBiasValue(shiftDown ? 0.1f : 1.0f);
else
QApplication::beep();
return;
case Qt::Key_Down:
if (getTrackCount() > editTrack)
editBiasValue(shiftDown ? -0.1f : -1.0f);
else
QApplication::beep();
return;
case Qt::Key_PageUp:
editBiasValue(shiftDown ? 100.0f : 10.0f);
return;
case Qt::Key_PageDown:
editBiasValue(shiftDown ? -100.0f : -10.0f);
return;
}
}
switch (event->key()) {
case Qt::Key_Up:
setEditRow(editRow - 1, selecting);
//.........这里部分代码省略.........