本文整理汇总了C++中QScrollBar::setOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollBar::setOrientation方法的具体用法?C++ QScrollBar::setOrientation怎么用?C++ QScrollBar::setOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollBar
的用法示例。
在下文中一共展示了QScrollBar::setOrientation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getNativeObject
/**
* Sets the orientation of the scrollbar
*/
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtScrollbarPeer_setOrientation
(JNIEnv *env, jobject obj, jint orientation)
{
QScrollBar *bar = (QScrollBar *) getNativeObject( env, obj );
assert( bar );
switch(orientation)
{
case HORIZONTAL:
bar->setOrientation ( Qt::Horizontal );
break;
default:
case VERTICAL:
bar->setOrientation ( Qt::Vertical );
break;
}
}
示例2: embeddedDocTxt
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent), ui(new Ui::MainWindow),
logNewMessages(0), logHasErrors(false), showNewLogNumber(true)
{
ui->setupUi(this);
setWindowIcon(QIcon(c_icon_app));
setWindowTitle(c_qtau_name);
setAcceptDrops(true);
setContextMenuPolicy(Qt::NoContextMenu);
//-----------------------------------------
QLabel *meterLabel = new QLabel(QString("%1/%2") .arg(ns.notesInBar).arg(ns.noteLength), this);
QLabel *tempoLabel = new QLabel(QString("%1 %2").arg(ns.tempo).arg(tr("bpm")), this);
QHBoxLayout *bpmHBL = new QHBoxLayout();
bpmHBL->setContentsMargins(0,0,0,0);
bpmHBL->addSpacing(5);
bpmHBL->addWidget(meterLabel);
bpmHBL->addWidget(tempoLabel);
bpmHBL->addSpacing(5);
QFrame *tempoPanel = new QFrame(this);
tempoPanel->setMinimumSize(c_piano_min_width, c_meter_min_height);
tempoPanel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
tempoPanel->setContentsMargins(1,0,1,1);
tempoPanel->setFrameStyle(QFrame::Panel | QFrame::Raised);
tempoPanel->setLayout(bpmHBL);
meter = new qtauMeterBar(this);
meter->setMinimumHeight(c_meter_min_height);
meter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
meter->setContentsMargins(0,0,0,0);
piano = new qtauPiano(ui->centralWidget);
piano->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
piano->setMinimumSize(c_piano_min_width, c_piano_min_height);
piano->setContentsMargins(0,0,0,0);
zoom = new QSlider(Qt::Horizontal, ui->centralWidget);
zoom->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
zoom->setRange(0, c_zoom_num - 1);
zoom->setSingleStep(1);
zoom->setPageStep(1);
zoom->setValue(cdef_zoom_index);
zoom->setMinimumWidth(c_piano_min_width);
zoom->setGeometry(0,0,c_piano_min_width,10);
zoom->setContentsMargins(0,0,0,0);
noteEditor = new qtauNoteEditor(ui->centralWidget);
noteEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
noteEditor->setContentsMargins(0,0,0,0);
hscr = new QScrollBar(Qt::Horizontal, ui->centralWidget);
vscr = new QScrollBar(Qt::Vertical, ui->centralWidget);
hscr->setContentsMargins(0,0,0,0);
vscr->setContentsMargins(0,0,0,0);
hscr->setRange(0, ns.note.width() * ns.notesInBar * cdef_bars);
vscr->setRange(0, ns.note.height() * 12 * ns.numOctaves);
hscr->setSingleStep(ns.note.width());
vscr->setSingleStep(ns.note.height());
hscr->setContextMenuPolicy(Qt::NoContextMenu);
vscr->setContextMenuPolicy(Qt::NoContextMenu);
//---- vocal and music waveform panels, hidden until synthesized (vocal wave) and/or loaded (music wave)
QScrollBar *dummySB = new QScrollBar(this);
dummySB->setOrientation(Qt::Vertical);
dummySB->setRange(0,0);
dummySB->setEnabled(false);
QFrame *vocalControls = new QFrame(this);
vocalControls->setContentsMargins(0,0,0,0);
vocalControls->setMinimumSize(c_piano_min_width, c_waveform_min_height);
vocalControls->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
vocalControls->setFrameStyle(QFrame::Panel | QFrame::Raised);
vocalWave = new qtauWaveform(this);
vocalWave->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
vocalWave->setMinimumHeight(c_waveform_min_height);
vocalWave->setContentsMargins(0,0,0,0);
QHBoxLayout *vocalWaveL = new QHBoxLayout();
vocalWaveL->setContentsMargins(0,0,0,0);
vocalWaveL->setSpacing(0);
vocalWaveL->addWidget(vocalControls);
vocalWaveL->addWidget(vocalWave);
vocalWaveL->addWidget(dummySB);
vocalWavePanel = new QWidget(this);
vocalWavePanel->setContentsMargins(0,0,0,0);
vocalWavePanel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
vocalWavePanel->setLayout(vocalWaveL);
vocalWavePanel->setVisible(false);
//---------
//.........这里部分代码省略.........