本文整理汇总了C++中sliderPressed函数的典型用法代码示例。如果您正苦于以下问题:C++ sliderPressed函数的具体用法?C++ sliderPressed怎么用?C++ sliderPressed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sliderPressed函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QWidget
SliderSpinBoxWidget::SliderSpinBoxWidget(QWidget* parent)
: QWidget(parent)
, isSliderTrackingEnabled_(true)
, isSpinboxTrackingEnabled_(false)
{
layout_ = new QHBoxLayout(this);
layout_->setSpacing(6);
layout_->setMargin(0);
slider_ = new QSlider(this);
slider_->setOrientation(Qt::Horizontal);
slider_->setTickPosition(QSlider::NoTicks);
slider_->setTickInterval(5);
layout_->addWidget(slider_);
spinbox_ = new QSpinBox(this);
layout_->addWidget(spinbox_);
// signals and slots connections
connect(slider_, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
connect(slider_, SIGNAL(sliderPressed()), this, SLOT(sliderPressed()));
connect(slider_, SIGNAL(sliderReleased()), this, SLOT(sliderReleased()));
connect(spinbox_, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
connect(spinbox_, SIGNAL(editingFinished()), this, SLOT(spinEditingFinished()));
value_ = getValue();
setSliderTracking(isSliderTrackingEnabled_);
setSpinboxTracking(isSpinboxTrackingEnabled_);
}
开发者ID:MKLab-ITI,项目名称:gnorasi,代码行数:30,代码来源:sliderspinboxwidget.cpp
示例2: TriangleSliderButton
unsigned int GradientSliderWidget::AddSlider()
{
TriangleSliderButton *newSlider = new TriangleSliderButton(this);
unsigned int newID = newSlider->GetID();
if (!sliders.contains(newID))
{
newSlider->SetValue((minValue + maxValue) / 2.0);
newSlider->SetColor(QColor::fromRgb(0, 0, 0));
connect(newSlider, SIGNAL(sliderPressed(uint)), this, SLOT(sliderPressed(uint)));
connect(newSlider, SIGNAL(sliderReleased(uint)), this, SLOT(sliderReleased(uint)));
connect(newSlider, SIGNAL(colorChanged(uint,QColor)), this, SLOT(updateGradientStops(uint,QColor)));
connect(newSlider, SIGNAL(removeSlider(uint)), this, SLOT(removeSlider(uint)));
sliders[newID] = newSlider;
newSlider->show();
CheckSliderCount();
emit sliderAdded(newID, newSlider->GetValue(), newSlider->GetColor());
return newID;
} else {
delete newSlider;
}
return 0;
}
开发者ID:jlaketrask,项目名称:adcircSubdomainTool,代码行数:26,代码来源:GradientSliderWidget.cpp
示例3: url
void PlayerControls::setupSliders()
{
QString lblStyle = "QLabel { color: #555; font-size: 9px; }";
m_styleSlider = "::sub-page:horizontal { background-image: url(:/images/prog_sub); } ::add-page:horizontal { background-image: url(:/images/prog_add); } ::groove:horizontal {background: transparent; } ::handle:horizontal {image: url(:/images/handle);} ::handle:horizontal:hover {image: url(:/images/handle_hover);}";
QHBoxLayout *layout = new QHBoxLayout();
// Seek
m_wSeekSlider = new QSlider(this);
m_wSeekSlider->setOrientation(Qt::Horizontal);
m_wSeekSlider->setFixedHeight(20);
m_wSeekSlider->setStyleSheet(m_styleSlider);
m_wSeekSlider->setMaximum(1000);
m_wSeekSlider->setTickInterval(10);
m_wSeekSlider->installEventFilter(this);
m_bTickSlider = true;
m_wlCurTime = new QLabel("0:00");
m_wlCurTime->setStyleSheet(lblStyle);
m_wlTotTime = new QLabel("0:00");
m_wlTotTime->setStyleSheet(lblStyle);
// Volume
m_wVolumeSlider = new QSlider(this);
m_wVolumeSlider->setOrientation(Qt::Horizontal);
m_wVolumeSlider->setFixedHeight(20);
m_wVolumeSlider->setMaximumWidth(100);
m_wVolumeSlider->setObjectName("volumeSlider");
m_wVolumeSlider->setStyleSheet(m_styleSlider);
m_wVolumeSlider->setValue(75);
m_wVolumeSlider->setMaximum(100);
m_wlCurVolume = new QLabel("75");
m_wlCurVolume->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
m_wlCurVolume->setMinimumWidth(18);
m_wlCurVolume->setStyleSheet(lblStyle);
// Layouts
layout->addWidget(m_wlCurTime);
layout->addWidget(m_wSeekSlider);
layout->addWidget(m_wlTotTime);
layout->addSpacing(30);
layout->addWidget(m_wlCurVolume);
layout->addWidget(m_wVolumeSlider);;
// Connection
//connect(m_wVolumeSlider, SIGNAL(valueChanged(int)), SLOT(setVolume(int)));
connect(m_wVolumeSlider, SIGNAL(valueChanged(int)), SLOT(onVolumeChanged(int)));
connect(m_wSeekSlider, SIGNAL(sliderPressed()), SLOT(sliderPressed()));
connect(m_wSeekSlider, SIGNAL(sliderReleased()), SLOT(sliderReleased()));
m_mainLayout->addLayout(layout, 1, 1);
}
开发者ID:maxvanceffer,项目名称:pulsar,代码行数:57,代码来源:playercontrols.cpp
示例4: qDebug
// Based on code from qslider.cpp
void Slider::mousePressEvent( QMouseEvent *e )
{
qDebug("pressed (%d, %d)", e->pos().x(), e->pos().y());
if( e->button() == Qt::LeftButton )
{
qDebug( "Left button" );
QStyleOptionSlider opt;
initStyleOption( &opt );
const QRect sliderRect = style()->subControlRect( QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this );
const QPoint center = sliderRect.center() - sliderRect.topLeft();
// to take half of the slider off for the setSliderPosition call we use the center - topLeft
if ( ! sliderRect.contains( e->pos() ) )
{
qDebug( "accept" );
e->accept();
int v = pixelPosToRangeValue( pick( e->pos() - center ) );
setSliderPosition( v );
triggerAction( SliderMove );
setRepeatAction( SliderNoAction );
emit sliderMoved( v );//TODO: ok?
emit sliderPressed(); //TODO: ok?
}
else
{
QSlider::mousePressEvent( e );
}
}
else
{
QSlider::mousePressEvent( e );
}
}
开发者ID:MarcAntoine-Arnaud,项目名称:QtAV,代码行数:35,代码来源:Slider.cpp
示例5: BT_CONNECT
void BtQmlScrollView::initScrollBar() {
m_scrollBar->setRange(-100,100);
m_scrollBar->setValue(0);
BT_CONNECT(m_scrollBar, SIGNAL(sliderMoved(int)), this, SLOT(slotSliderMoved(int)));
BT_CONNECT(m_scrollBar, SIGNAL(sliderPressed()), this, SLOT(slotSliderPressed()));
BT_CONNECT(m_scrollBar, SIGNAL(sliderReleased()), this, SLOT(slotSliderReleased()));
}
开发者ID:bibletime,项目名称:bibletime,代码行数:7,代码来源:btqmlscrollview.cpp
示例6: MySlider
TimeSlider::TimeSlider( QWidget * parent ) : MySlider(parent)
{
dont_update = FALSE;
setMinimum(0);
#ifdef SEEKBAR_RESOLUTION
setMaximum(SEEKBAR_RESOLUTION);
#else
setMaximum(100);
#endif
setFocusPolicy( Qt::NoFocus );
setSizePolicy( QSizePolicy::Expanding , QSizePolicy::Fixed );
connect( this, SIGNAL( sliderPressed() ), this, SLOT( stopUpdate() ) );
connect( this, SIGNAL( sliderReleased() ), this, SLOT( resumeUpdate() ) );
connect( this, SIGNAL( sliderReleased() ), this, SLOT( mouseReleased() ) );
connect( this, SIGNAL( valueChanged(int) ), this, SLOT( valueChanged_slot(int) ) );
#if ENABLE_DELAYED_DRAGGING
connect( this, SIGNAL(draggingPos(int) ), this, SLOT(checkDragging(int)) );
last_pos_to_send = -1;
timer = new QTimer(this);
connect( timer, SIGNAL(timeout()), this, SLOT(sendDelayedPos()) );
timer->start(200);
#endif
}
开发者ID:rdp,项目名称:smplayer-svn,代码行数:26,代码来源:timeslider.cpp
示例7: connect
void MainWindow::makeConnections()
{
connect(pt_videocapture, SIGNAL(positionUpdated(int)), ui->positionSlider, SLOT(setValue(int)));
connect(ui->positionSlider, SIGNAL(sliderPressed()), pt_videocapture, SLOT(pause()));
connect(ui->positionSlider, SIGNAL(sliderReleased(int)), pt_videocapture, SLOT(setPosition(int)));
connect(ui->positionSlider, SIGNAL(sliderReleased(int)), pt_videocapture, SLOT(resume()));
connect(pt_videocapture, SIGNAL(framesInFile(int)), ui->positionSlider, SLOT(setMaxValue(int)));
connect(ui->resumeButton, SIGNAL(pressed()), pt_resumeAct, SLOT(trigger()));
connect(ui->pauseButton, SIGNAL(pressed()), pt_pauseAct, SLOT(trigger()));
connect(ui->backwardButton, SIGNAL(pressed()), pt_backwardAct, SLOT(trigger()));
connect(ui->forwardButton, SIGNAL(pressed()), pt_forwardAct, SLOT(trigger()));
connect(ui->speeddownButton, SIGNAL(pressed()), pt_speeddownAct, SLOT(trigger()));
connect(ui->speedupButton, SIGNAL(pressed()), pt_speedupAct, SLOT(trigger()));
connect(pt_videocapture, SIGNAL(positionUpdated(int)), ui->frameLCD, SLOT(display(int)));
connect(pt_videocapture, SIGNAL(framesInFile(int)), ui->totalframesLCD, SLOT(display(int)));
connect(pt_stasm, SIGNAL(frametimeUpdated(double)), ui->frametimeLCD, SLOT(display(double)));
connect(pt_opencv, SIGNAL(snrUpdated(double)), ui->snrLCD, SLOT(display(double)));
connect(pt_opencv, SIGNAL(contrastUpdated(double)), ui->contrastLCD, SLOT(display(double)));
connect(pt_stasm, SIGNAL(eyesdistanceUpdated(double)), ui->eyesLCD, SLOT(display(double)));
qRegisterMetaType<cv::Rect>("cv::Rect");
connect(pt_stasm, SIGNAL(facerectUpdated(cv::Rect)), ui->display, SLOT(updateSelection(cv::Rect)));
//seriesanalyzer part
connect(ui->dataseriaW, SIGNAL(stateChanged(bool)), this, SLOT(dataanalysconnection(bool)));
connect(pt_seriesanalyzer, SIGNAL(seriesFound(DataSeria,uint,uint)), ui->dataseriaW, SLOT(updateSeries(DataSeria,uint,uint)));
connect(ui->dataseriaW, SIGNAL(moveBackward()), pt_seriesanalyzer, SLOT(stepBackward()));
connect(ui->dataseriaW, SIGNAL(moveForward()), pt_seriesanalyzer, SLOT(stepForward()));
connect(ui->dataseriaW, SIGNAL(clearHistory()), pt_seriesanalyzer, SLOT(clearSeriesHistory()));
}
开发者ID:pi-null-mezon,项目名称:Interview,代码行数:33,代码来源:mainwindow.cpp
示例8: setValue
void WaSlider::mousePressEvent(QMouseEvent *e) {
if (e->button() != LeftButton && e->button() != MidButton) {
WaWidget::mousePressEvent(e);
return;
}
int maxX = slider_x - slider_width;
if(mapping == _WA_MAPPING_VOLUME_BAR)
maxX -= 3;
if ((e->x() < slider_x) || (e->x() > (maxX))) {
int newX = e->x();
newX -= (slider_width / 2);
setValue(pixel2Value(newX));
}
pressPoint.setX(e->x() - slider_x);
lDragging = true;
update();
emit(sliderPressed());
}
开发者ID:serghei,项目名称:kde3-kdemultimedia,代码行数:25,代码来源:waSlider.cpp
示例9: setWindowTitle
QPlayer::QPlayer(QTimer *timer1, QTimer *timer2, QFile *file1)
{
playTimer = timer1;
refreshTimer = timer2;
file = file1;
QDesktopWidget *desktop = new QDesktopWidget;
setWindowTitle("QPlayer");
setGeometry(desktop->width()-100, desktop->height()-60, 220, 25);
xSize = 130;
ySize = 30;
busy = false;
slider = new QSlider(Qt::Horizontal,this);
QPushButton *playButton = new QPushButton(QIcon(":/icons/amarok_play.png"),"");
QPushButton *pauseButton = new QPushButton(QIcon(":/icons/amarok_pause.png"),"");
playButton->setFlat(true);
pauseButton->setFlat(true);
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(playButton);
layout->addWidget(pauseButton);
layout->addWidget(slider);
connect(playButton, SIGNAL(released()), this, SLOT(play() ) );
connect(pauseButton,SIGNAL(released()), this, SLOT(pause()) );
connect(slider,SIGNAL(sliderReleased()), this, SLOT(seekFile()) );
connect(slider,SIGNAL(sliderPressed()), this, SLOT(sliderPress()) );
setLayout(layout);
show();
}
开发者ID:MOTTechnologies,项目名称:ECUmanager,代码行数:33,代码来源:QPlayer.cpp
示例10: QHBoxLayout
void KisColorSliderInput::init()
{
QHBoxLayout* m_layout = new QHBoxLayout(this);
m_layout->setContentsMargins(0, 0, 0, 0);
m_layout->setSpacing(1);
QString m_name;
switch (m_type){
case 0: m_name=i18n("Hue"); break;
case 1: m_name=i18n("Saturation"); break;
case 2: m_name=i18n("Value"); break;
case 3: m_name=i18n("Hue"); break;
case 4: m_name=i18n("Saturation"); break;
case 5: m_name=i18n("Lightness"); break;
case 6: m_name=i18n("Hue"); break;
case 7: m_name=i18n("Saturation"); break;
case 8: m_name=i18n("Intensity"); break;
case 9: m_name=i18n("Hue"); break;
case 10: m_name=i18n("Saturation"); break;
case 11: m_name=i18n("Luma"); break;
}
QLabel* m_label = new QLabel(i18n("%1:", m_name), this);
m_layout->addWidget(m_label);
m_hsvSlider = new KisHSVSlider(Qt::Horizontal, this, m_displayRenderer, m_canvas);
m_hsvSlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
m_layout->addWidget(m_hsvSlider);
connect (m_hsvSlider, SIGNAL(sliderPressed()), SLOT(sliderIn()));
connect (m_hsvSlider, SIGNAL(sliderReleased()), SLOT(sliderOut()));
QWidget* m_input = createInput();
m_hsvSlider->setFixedHeight(m_input->sizeHint().height());
m_layout->addWidget(m_input);
}
开发者ID:ChrisJong,项目名称:krita,代码行数:35,代码来源:kis_color_slider_input.cpp
示例11: setBackgroundPixmap
void SubBarPlayer::xSetup()
{
//DAVID Setup Background;
pixBackground.load("/root/kde_application/hdass08/skin/SubBarBackground.png");
setBackgroundPixmap(pixBackground);
//DAVID Load BtnGraphic
BtnGraphic[0]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Previous.png");
BtnGraphic[1]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Previous-Active.png");
BtnGraphic[2]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Play.png");
BtnGraphic[3]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Play-Active.png");
BtnGraphic[4]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Pause.png");
BtnGraphic[5]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Pause-Active.png");
BtnGraphic[6]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Next.png");
BtnGraphic[7]=new QPixmap("/root/kde_application/hdass08/skin/Bar-Player-Btn-Next-Active.png");
SubBtnPlayer_PlayNPause =new SkinButton(this);
SubBtnPlayer_Backword =new SkinButton(this);
SubBtn_Forward =new SkinButton(this);
SubBtnPlayer_Backword->setPixmaps(BtnGraphic[0],BtnGraphic[1]);
SubBtnPlayer_Backword->setGeometry(336,0,60,80);
SubBtnPlayer_Backword->show();
SubBtnPlayer_PlayNPause->setPixmaps(BtnGraphic[2],BtnGraphic[3]);
SubBtnPlayer_PlayNPause->setGeometry(403,0,80,80);
SubBtnPlayer_PlayNPause->show();
SubBtn_Forward->setPixmaps(BtnGraphic[6],BtnGraphic[7]);
SubBtn_Forward->setGeometry(484,0,60,80);
SubBtn_Forward->show();
//DAVID Pos Slider
playerPosition = new QSlider(0,100,1,0,Qt::Horizontal,this);
playerPosition->setGeometry( QRect(10,39,300,15) );
//playerPosition->show();
QObject::connect(SubBtnPlayer_PlayNPause, SIGNAL(clicked()), m_player, SLOT(play()));
QObject::connect(SubBtnPlayer_PlayNPause,SIGNAL(clicked()),this,SLOT(ChangeBtnPlayPauseGraphic()));
QObject::connect(SubBtn_Forward, SIGNAL(clicked()), m_player, SLOT(next()));
QObject::connect(SubBtnPlayer_Backword, SIGNAL(clicked()), m_player, SLOT(previous()));
state=SubBarPlayer::GO;
connect(m_player, SIGNAL(positionMessage(int)), this, SLOT(handlePosition(int )));
connect(m_player,SIGNAL(trackMessage(int, int, QString, QString, QString )),this,SLOT(handleMessage(int, int, QString, QString, QString )));
connect(playerPosition, SIGNAL(sliderPressed()), this, SLOT(handleSliderPressed()));
connect(playerPosition, SIGNAL(sliderReleased()), this, SLOT(handleSliderReleased()));
forwardTimer = new QTimer( this ); // create internal timer
connect( forwardTimer, SIGNAL(timeout()),this, SLOT(handleForward()) );
backwardTimer = new QTimer( this );
connect( backwardTimer, SIGNAL(timeout()), this, SLOT(handleBackward()) );
slotReadList();
}
开发者ID:chunyisu,项目名称:hdass,代码行数:60,代码来源:subbarplayer.cpp
示例12: QFrame
VideoControls::VideoControls(QWidget *parent) : QFrame (parent) {
setEnabled(false);
m_isTracking = false;
m_isPlaying = false;
m_autoHide = false;
m_hbox = new QHBoxLayout(this);
m_hbox->setSizeConstraint(QLayout::SetMinimumSize);
m_hbox->setContentsMargins(0,0,0,0);
m_hbox->setSpacing(4);
m_prevButton = new QToolButton(this);
m_hbox->addWidget(m_prevButton);
m_prevButton->setFixedSize(24, 24);
m_prevButton->setAutoRaise(true);
m_prevButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaSeekBackward));
m_prevButton->setAutoRepeat(true);
m_prevButton->setAutoRepeatInterval(1000/50);
m_playButton = new QToolButton(this);;
m_hbox->addWidget(m_playButton);
m_playButton->setFixedSize(24, 24);
m_playButton->setAutoRaise(true);
m_playButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaPlay));
m_nextButton = new QToolButton(this);;
m_hbox->addWidget(m_nextButton);
m_nextButton->setFixedSize(24, 24);
m_nextButton->setAutoRaise(true);
m_nextButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaSeekForward));
m_nextButton->setAutoRepeat(true);
m_nextButton->setAutoRepeatInterval(1000/50);
m_frameSlider = new QSlider(this);
m_hbox->addWidget(m_frameSlider);
m_frameSlider->setMinimumHeight(24);
m_frameSlider->setRange(0,0);
m_frameSlider->setFocusPolicy(Qt::NoFocus);
m_frameSlider->setOrientation(Qt::Horizontal);
m_frameSlider->setTracking(false);
m_frameEdit = new QSpinBox(this);
m_hbox->addWidget(m_frameEdit);
m_frameEdit->setMinimumHeight(24);
m_frameEdit->setRange(0,0);
m_frameEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
m_frameEdit->setAlignment(Qt::AlignCenter);
m_frameEdit->setKeyboardTracking(false);
connect(m_prevButton, SIGNAL(clicked()), this, SIGNAL(stepBack()));
connect(m_playButton, SIGNAL(clicked()), this, SLOT(toogle()));
connect(m_nextButton, SIGNAL(clicked()), this, SIGNAL(stepForward()));
connect(m_frameSlider, SIGNAL(valueChanged(int)), this, SIGNAL(currentFrameChanged(int)));
connect(m_frameSlider, SIGNAL(sliderMoved(int)), this, SIGNAL(currentFrameTracked(int)));
connect(m_frameSlider, SIGNAL(sliderPressed()), this, SLOT(handleSliderPressed()));
connect(m_frameSlider, SIGNAL(sliderReleased()), this, SLOT(handleSliderReleased()));
connect(m_frameEdit, SIGNAL(valueChanged(int)), this, SIGNAL(currentFrameChanged(int)));
}
开发者ID:emailhy,项目名称:jhfan88-liboz,代码行数:60,代码来源:videocontrols.cpp
示例13: Q_Q
// --------------------------------------------------------------------------
void ctkRangeWidgetPrivate::connectSlider()
{
Q_Q(ctkRangeWidget);
QObject::connect(this->Slider, SIGNAL(valuesChanged(double, double)),
q, SLOT(changeValues(double,double)));
QObject::connect(this->Slider, SIGNAL(minimumValueChanged(double)),
q, SLOT(changeMinimumValue(double)));
QObject::connect(this->Slider, SIGNAL(maximumValueChanged(double)),
q, SLOT(changeMaximumValue(double)));
QObject::connect(this->MinimumSpinBox, SIGNAL(valueChanged(double)),
this->Slider, SLOT(setMinimumValue(double)));
QObject::connect(this->MaximumSpinBox, SIGNAL(valueChanged(double)),
this->Slider, SLOT(setMaximumValue(double)));
QObject::connect(this->MinimumSpinBox, SIGNAL(valueChanged(double)),
q, SLOT(setMinimumToMaximumSpinBox(double)));
QObject::connect(this->MaximumSpinBox, SIGNAL(valueChanged(double)),
q, SLOT(setMaximumToMinimumSpinBox(double)));
QObject::connect(this->Slider, SIGNAL(sliderPressed()),
q, SLOT(startChanging()));
QObject::connect(this->Slider, SIGNAL(sliderReleased()),
q, SLOT(stopChanging()));
QObject::connect(this->Slider, SIGNAL(rangeChanged(double, double)),
q, SLOT(onSliderRangeChanged(double, double)));
}
开发者ID:xplanes,项目名称:CTK,代码行数:27,代码来源:ctkRangeWidget.cpp
示例14: sliderPressed
void NSlider::mousePressEvent(QMouseEvent *event)
{
if (event->button() != Qt::RightButton) {
emit sliderPressed();
QStyleOptionSlider opt;
initStyleOption(&opt);
QRect gr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove, this);
QRect sr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this);
int pxMin;
int pxMax;
if (orientation() == Qt::Horizontal) {
pxMin = gr.x() + sr.width() / 2;
pxMax = gr.right() - sr.width() / 2 + 1;
} else {
pxMin = gr.y() + sr.height() / 2;
pxMax = gr.bottom() - sr.height() / 2 + 1;
}
setValue(QStyle::sliderValueFromPosition(minimum(), maximum(), event->x() - pxMin, pxMax - pxMin, opt.upsideDown));
emit sliderMoved(value());
}
QSlider::mousePressEvent(event);
}
开发者ID:vkolev,项目名称:nulloy,代码行数:27,代码来源:slider.cpp
示例15: model
void knob::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() == Qt::LeftButton &&
! ( _me->modifiers() & Qt::ControlModifier ) &&
! ( _me->modifiers() & Qt::ShiftModifier ) )
{
model()->prepareJournalEntryFromOldVal();
const QPoint & p = _me->pos();
m_origMousePos = p;
m_mouseOffset = QPoint(0, 0);
m_leftOver = 0.0f;
emit sliderPressed();
QApplication::setOverrideCursor( Qt::BlankCursor );
s_textFloat->setText( displayValue() );
s_textFloat->moveGlobal( this,
QPoint( width() + 2, 0 ) );
s_textFloat->show();
m_buttonPressed = true;
}
else if( _me->button() == Qt::LeftButton &&
engine::mainWindow()->isShiftPressed() == true )
{
new stringPairDrag( "float_value",
QString::number( model()->value() ),
QPixmap(), this );
}
else
{
FloatModelView::mousePressEvent( _me );
}
}
开发者ID:Pavleen30,项目名称:SOEN6471,代码行数:34,代码来源:knob.cpp
示例16: setValue
void DSlider::mousePressEvent(QMouseEvent *event)
{
QAbstractSlider::mousePressEvent(event);
if (event->button() == Qt::LeftButton) {
if (orientation() == Qt::Vertical) {
setValue(minimum() + ((maximum() - minimum()) * (height() - event->y())) / height()) ;
} else {
// FIXME
// the value 10 is specified in DSlider.theme, it's ugly here, but I don't have any
// good idea for now, maybe someone can help.
setValue(minimum() + ((maximum() - minimum()) * (event->x() - 10)) / (width() - 10 - 10)) ;
}
event->accept();
Q_D(DSlider);
QStyleOptionSlider opt;
initStyleOption(&opt);
setRepeatAction(SliderNoAction);
QRect sr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this);
d->clickOffset = d->pick(event->pos() - sr.topLeft());
d->mousePressed = true;
emit sliderPressed();
}
}
开发者ID:zccrs,项目名称:deepin-tool-kit,代码行数:29,代码来源:dslider.cpp
示例17: connect
MediaPlayer::MediaPlayer(Data::DataManager * const _dataManager)
:dataManager(_dataManager)
,player(_dataManager)
{
auto videoWidget = new Video::Widget();
auto surface = videoWidget->videoSurface();
player.start(surface);
mediaControl = player.getMediaControl();
playPauseButton = new QPushButton;
playPauseButton->setEnabled(false);
playPauseButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));
playPauseButton->setText("PlayPause");
connect(playPauseButton, SIGNAL(clicked()),this, SLOT(playPause()));
positionSlider = new QSlider(Qt::Horizontal);
positionSlider->setRange(0, 10000);
connect(positionSlider, SIGNAL(sliderMoved(int)),this, SLOT(sliderChanged(int)));
connect(positionSlider, SIGNAL(sliderPressed()),this, SLOT(sliderPressed()));
connect(positionSlider, SIGNAL(sliderReleased()),this, SLOT(sliderReleased()));
connect(surface, SIGNAL(frameChanged(I8u)),this, SLOT(frameChanged(I8u)));
connect(surface, SIGNAL(durationFramesChanged(I8u)),this, SLOT(durationFramesChanged(I8u)));
connect(this, SIGNAL(setSlider(int)),positionSlider, SLOT(setValue(int)));
QBoxLayout * controlLayout = new QHBoxLayout;
controlLayout->addWidget(playPauseButton);
controlLayout->addWidget(positionSlider);
QBoxLayout * layout = new QVBoxLayout;
layout->addWidget(videoWidget);
layout->addLayout(controlLayout);
createActions();
createMenus();
auto window = new QWidget;
window->setLayout(layout);
setCentralWidget(window);
setWindowTitle(tr("Media Player"));
resize(600, 600);
}
开发者ID:Argoday,项目名称:IPL,代码行数:47,代码来源:MediaPlayer.cpp
示例18: connect
void TransFunc1DRampEditor::createConnections() {
// Buttons
connect(clearButton_, SIGNAL(clicked()), this, SLOT(clearButtonClicked()));
connect(loadButton_, SIGNAL(clicked()), this, SLOT(loadTransferFunction()));
connect(saveButton_, SIGNAL(clicked()), this, SLOT(saveTransferFunction()));
// signals from transferMappingCanvas
connect(transCanvas_, SIGNAL(changed()), this, SLOT(updateTransferFunction()));
connect(transCanvas_, SIGNAL(loadTransferFunction()), this, SLOT(loadTransferFunction()));
connect(transCanvas_, SIGNAL(saveTransferFunction()), this, SLOT(saveTransferFunction()));
connect(transCanvas_, SIGNAL(resetTransferFunction()), this, SLOT(clearButtonClicked()));
connect(transCanvas_, SIGNAL(toggleInteractionMode(bool)), this, SLOT(toggleInteractionMode(bool)));
// signals for colorPicker
connect(transCanvas_, SIGNAL(colorChanged(const QColor&)),
colorPicker_, SLOT(setCol(const QColor)));
connect(transCanvas_, SIGNAL(colorChanged(const QColor&)),
colorLumPicker_, SLOT(setCol(const QColor)));
connect(colorPicker_, SIGNAL(newCol(int,int)),
colorLumPicker_, SLOT(setCol(int,int)));
connect(colorLumPicker_, SIGNAL(newHsv(int,int,int)),
this, SLOT(markerColorChanged(int,int,int)));
connect(colorPicker_, SIGNAL(toggleInteractionMode(bool)), this, SLOT(toggleInteractionMode(bool)));
connect(colorLumPicker_, SIGNAL(toggleInteractionMode(bool)), this, SLOT(toggleInteractionMode(bool)));
// doubleslider
connect(doubleSlider_, SIGNAL(valuesChanged(float, float)), this, SLOT(thresholdChanged(float, float)));
connect(doubleSlider_, SIGNAL(toggleInteractionMode(bool)), this, SLOT(toggleInteractionMode(bool)));
// threshold spinboxes
connect(lowerThresholdSpin_, SIGNAL(valueChanged(int)), this, SLOT(lowerThresholdSpinChanged(int)));
connect(upperThresholdSpin_, SIGNAL(valueChanged(int)), this, SLOT(upperThresholdSpinChanged(int)));
connect(checkClipThresholds_, SIGNAL(toggled(bool)), transCanvas_, SLOT(toggleClipThresholds(bool)));
//ramp slider and spinboxes
connect(sliderRampCenter_, SIGNAL(valueChanged(int)), this, SLOT(updateRampCenter(int)));
connect(spinRampCenter_, SIGNAL(valueChanged(int)), this, SLOT(updateRampCenter(int)));
connect(spinRampWidth_, SIGNAL(valueChanged(int)), this, SLOT(updateRampWidth(int)));
connect(sliderRampWidth_, SIGNAL(valueChanged(int)), this, SLOT(updateRampWidth(int)));
connect(sliderRampCenter_, SIGNAL(sliderPressed()), this, SLOT(startTracking()));
connect(sliderRampWidth_, SIGNAL(sliderPressed()), this, SLOT(startTracking()));
connect(sliderRampCenter_, SIGNAL(sliderReleased()), this, SLOT(stopTracking()));
connect(sliderRampWidth_, SIGNAL(sliderReleased()), this, SLOT(stopTracking()));
}
开发者ID:MKLab-ITI,项目名称:gnorasi,代码行数:46,代码来源:transfunc1drampeditor.cpp
示例19: connect
void DrawWidget::SetScaleControl(QScaleSlider * pScale)
{
m_pScale = pScale;
connect(m_pScale, SIGNAL(actionTriggered(int)), this, SLOT(ScaleChanged(int)));
connect(m_pScale, SIGNAL(sliderPressed()), this, SLOT(SliderPressed()));
connect(m_pScale, SIGNAL(sliderReleased()), this, SLOT(SliderReleased()));
}
开发者ID:65apps,项目名称:omim,代码行数:8,代码来源:draw_widget.cpp
示例20: QMainWindow
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, _ui(new Ui::MainWindow)
, _midiOutput(new CxxMidi::Output::Default(0))
, _midiPlayer(new CxxMidi::Player::Asynchronous(_midiOutput))
, _midiFile(0)
, _sliderLocked(false)
{
_ui->setupUi(this);
this->createMenuBar();
this->centralWidget()->setDisabled(true);
this->resize(this->minimumSizeHint());
_midiPlayer->setCallbackHeartbeat(&_playerHeartbeatCallback);
connect(&_playerHeartbeatCallback,SIGNAL(playerTimeChanged(CxxMidi::Time::Point)),
this,SLOT(updateTimeCode(CxxMidi::Time::Point)),Qt::QueuedConnection);
_midiPlayer->setCallbackFinished(&_playerFinishedCallback);
connect(&_playerFinishedCallback,SIGNAL(playerFinished()),
this,SLOT(playerFinished()),Qt::QueuedConnection);
connect(_ui->doubleSpinBoxSpeed,SIGNAL(valueChanged(double)),
this,SLOT(onSpeedChange(double)));
connect(_ui->pushButtonPlay,SIGNAL(clicked()),
this,SLOT(onPlayClicked()));
connect(_ui->pushButtonPause,SIGNAL(clicked()),
this,SLOT(onPauseClicked()));
connect(_ui->sliderTimeline,SIGNAL(sliderPressed()),
this,SLOT(onTimeSliderPressed()));
connect(_ui->sliderTimeline,SIGNAL(sliderReleased()),
this,SLOT(onTimeSliderReleased()));
// first argument is file name
if(QApplication::arguments().size() >=2 )
{
QString fileName = QApplication::arguments().at(1);
this->openFile(fileName);
}
// second argument is output num
if(QApplication::arguments().size() >=3)
{
int num = QApplication::arguments().at(2).toInt();
this->setOutput(num);
_outputsActionGroup->actions()[num]->setChecked(true);
}
// auto play
if( QApplication::arguments().size() >= 2)
_midiPlayer->play();
}
开发者ID:5tan,项目名称:cxxmidi,代码行数:57,代码来源:mainwindow.cpp
注:本文中的sliderPressed函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论