• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ buttonPressed函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中buttonPressed函数的典型用法代码示例。如果您正苦于以下问题:C++ buttonPressed函数的具体用法?C++ buttonPressed怎么用?C++ buttonPressed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: onRotateRight

void RadioMMI::readInput()
{
  long newPos;
  newPos = mEncoder->read();
  if (newPos != mEncoderPosition) {
    if (0 == newPos % 4) {
      if (newPos > mEncoderPosition) {
        mEncoderPosition = newPos;
        onRotateRight();
      } else if(newPos < mEncoderPosition) {
        mEncoderPosition = newPos;
        onRotateLeft();
      }
    }
  }

  if (!buttonPressed()) {
    mButtonState = NOT_PRESSED;
  } else if (buttonPressed()
      && mButtonState == NOT_PRESSED) {
    mButtonState = PRESSED;
    mButtonDownSince = millis();
    onPressed();
  } else if (buttonPressed()
      && mButtonState == PRESSED
      && ((millis() - mButtonDownSince) > 1000)) {
    mButtonState = LONG_PRESSED;
    onLongPressed();
  }
}
开发者ID:daijo,项目名称:RadioCtrl,代码行数:30,代码来源:RadioMMI.cpp


示例2: connect

void TopBoardConnectors_Controller::setConmutadorPuestaServicio(SingleButton *conmutador,SingleButton *luzLlaveDes,SingleButton *luzLlaveCon, SingleButton *arranqueDes,SingleButton *arranqueCon){
    m_conmutador = conmutador;
    m_conmutador->setButtonImage(QUrl("qrc:/resources/techo_manual_up.png"),QUrl("qrc:/resources/techo_manual_down.png"));

    m_luzLlaveDes = luzLlaveDes;
    m_luzLlaveDes->setButtonImage(QUrl("qrc:/resources/greenON_DES_techo.png"),QUrl("qrc:/resources/green_DES_techo.png"));
    m_luzLlaveDes->setClickeable(false);

    m_luzLlaveCon = luzLlaveCon;
    m_luzLlaveCon->setButtonImage(QUrl("qrc:/resources/redON_CON_techo.png"),QUrl("qrc:/resources/red_CON_techo.png"));
    m_luzLlaveCon->setClickeable(false);

    m_arranqueDes = arranqueDes;
    m_arranqueDes->setButtonImage(QUrl("qrc:/resources/greenON_DES_techo.png"),QUrl("qrc:/resources/green_DES_techo.png"));
    m_arranqueDes->setClickeable(false);

    m_arranqueCon = arranqueCon;
    m_arranqueCon->setButtonImage(QUrl("qrc:/resources/redON_CON_techo.png"),QUrl("qrc:/resources/red_CON_techo.png"));
    m_arranqueCon->setClickeable(false);

    m_conmutadorPuestaServicioStatus = false;
    m_subte->setConmutadorPuestaServicio(m_conmutadorPuestaServicioStatus);

    connect(m_conmutador,SIGNAL(buttonPressed()),this,SLOT(conmutadorPuestaServicioPressed()));
    connect(m_arranqueCon,SIGNAL(buttonPressed()),this,SLOT(conmutadorPuestaServicioAutomaticaConPressed()));
    connect(m_arranqueDes,SIGNAL(buttonPressed()),this,SLOT(conmutadorPuestaServicioAutomaticaDesPressed()));
}
开发者ID:Subtes,项目名称:smallProject,代码行数:27,代码来源:topboardconnectors_controller.cpp


示例3: button_callback

void button_callback(void) {
    if (buttonPressed()) {
        delayMilliseconds(50);   // wait 50ms for debounce
        if(buttonPressed())
        {
            change=1;
        }
    }
}
开发者ID:3dlogixbydesign,项目名称:squarewear,代码行数:9,代码来源:SquareWearDemo.c


示例4: buttonPressed

void LircRemoteControl::commandReceived(const QString &remote, const QString &button, int repeatCounter){
    if(remote == d->name){
        if(lircButtonToRemoteControlButton(button) != RemoteControlButton::Unknown){
            emit buttonPressed(RemoteControlButton(remote, lircButtonToRemoteControlButton(button), repeatCounter));
        } else {
            emit buttonPressed(RemoteControlButton(remote, formatNamespaceButton(button), repeatCounter));
        }
    }
}
开发者ID:KDE,项目名称:kremotecontrol,代码行数:9,代码来源:lircremotecontrol.cpp


示例5: readGrooveboxButtons

void readGrooveboxButtons() {
  if (buttonPressedNew(BUTTON1) && (!buttonPressed(BUTTON4))) {
    // start/stop live sequencer groovebox
    if (!seqRunning) {
      resetGroovebox();
      seqSynchStart = true;
      while ((buttonHeld(BUTTON1)) && (seqSynchStart)) {
	// wait until the button is released or until a MIDI event triggers the start
	if (buttonPressed(BUTTON4)) {
	  // save procedure
	  return;
	}
#ifdef MIDI_ENABLE
	MIDI.read();
#endif
#ifdef USBMIDI_ENABLE
	USBMIDI.read();
#endif
      }
    }
    seqSynchStart = false;
    seqRunning = !seqRunning;
    if (!seqRunning) {
      stopSequencer();
    }
  }

  if (buttonPressedNew(BUTTON2)) {
    // clear the sequence notes on this track.
    for(byte i=0;i<SEQ_LENGTH;i++) {
      seq[i][currentTrack].midiVal = UNSET;
      seq[i][currentTrack].transpose = 0;
    }
  }

  if ((buttonPressedNew(BUTTON3)) && (seqRunning)) {
    seqPreview = !seqPreview;
  }
  if (seqPreview) {
    ledState[PREVIEW_LED] = HIGH;
  }

  if (buttonPressedNew(BUTTON4)) {
    metronomeMode = (metronomeMode + 1) % 3;
    if ((metronomeMode == METRONOME_MODE_OFF) && (metronomeNoteIndex != UNSET)) {
      stopNote(metronomeNoteIndex);
      metronomeNoteIndex = UNSET;
    }
  }


}
开发者ID:synthino,项目名称:synthino_xm,代码行数:52,代码来源:groovebox.cpp


示例6: repaint

void ToolBarButton::mouseReleaseEvent(QMouseEvent *event)
{
    event->ignore(); // Move event goes to ToolBarWidget

    if (isToggleButton()) {
        // Leave tool buttons pressed
    }
    else {
        // Lift other buttons back to up
        pressed = false;
        repaint();

        if (toolbarwidget->dockingDone) {
            // User was only moving toolbar, do not open dialogs
        }
        else {
            // Open dialogs
            // Send button pressed signal for dialog and undo/new buttons
            if (isDialogButton() || type == ToolBarButton::ENew || type != ToolBarButton::EMMS) {
                emit buttonPressed(type);
            }
        }
    }

    QWidget::mouseReleaseEvent(event);
}
开发者ID:0312birdzhang,项目名称:QtQuicksand,代码行数:26,代码来源:toolbarbutton.cpp


示例7: connect

void RaspiLcdWidget::registerKey(QAbstractButton *butt, keyType key)
{
  m_butList.append(butt);
  m_keyList.append(key);
  connect(butt,SIGNAL(pressed()),this,SLOT(buttonPressed()));
  connect(butt,SIGNAL(released()),this,SLOT(buttonReleased()));
}
开发者ID:ValentinIllich,项目名称:Raspi-Hifi,代码行数:7,代码来源:QtEmulation.cpp


示例8: Q_CHECK_PTR

int QButtonGroup::insert( QButton *button, int id )
{
    if ( button->group() )
	button->group()->remove( button );

    static int seq_no = -2;
    QButtonItem *bi = new QButtonItem;
    Q_CHECK_PTR( bi );

    if ( id < -1 )
	bi->id = seq_no--;
    else if ( id == -1 )
	bi->id = buttons->count();
    else
	bi->id = id;

    bi->button = button;
    button->setGroup(this);
    buttons->append( bi );

    connect( button, SIGNAL(pressed()) , SLOT(buttonPressed()) );
    connect( button, SIGNAL(released()), SLOT(buttonReleased()) );
    connect( button, SIGNAL(clicked()) , SLOT(buttonClicked()) );
    connect( button, SIGNAL(toggled(bool)) , SLOT(buttonToggled(bool)) );

    if ( button->isToggleButton() && !button->isOn() &&
	 selected() && (selected()->focusPolicy() & TabFocus) != 0 )
	button->setFocusPolicy( (FocusPolicy)(button->focusPolicy() &
					      ~TabFocus) );

    return bi->id;
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:32,代码来源:qbuttongroup.cpp


示例9: moveBy

void Button::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
{
    moveBy(0, -1);
    mPressedEffect->setOffset(0, 2);
    if (boundingRect().contains(event->pos()))
        emit buttonPressed();
}
开发者ID:mehdioa,项目名称:qtmind,代码行数:7,代码来源:button.cpp


示例10: QDialog

encodingWindow::encodingWindow(QWidget *parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint)
 {
	ui.setupUi(this);

#ifndef _WIN32
	//check for root privileges
	if (getuid() == 0)
	{
		// set priority to normal, regardless of preferences
		ui.comboBoxPriority->setCurrentIndex(2);
	}
#endif

	connect(ui.checkBoxShutdown, SIGNAL(stateChanged(int)), this, SLOT(shutdownChanged(int)));
	connect(ui.pushButton, SIGNAL(pressed()), this, SLOT(buttonPressed()));
	connect(ui.comboBoxPriority, SIGNAL(currentIndexChanged(int)), this, SLOT(priorityChanged(int)));

	// set priority
	uint32_t priority;

	prefs->get(PRIORITY_ENCODING,&priority);	

#ifndef _WIN32
	// check for root privileges
	if (getuid() == 0)
	{
		ui.comboBoxPriority->setCurrentIndex(priority);
	}
#else
	ui.comboBoxPriority->setCurrentIndex(priority);
#endif
 }
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:32,代码来源:Q_encoding.cpp


示例11: switch

int WebcamWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QGLWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: sliderMoved((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: buttonPressed((*reinterpret_cast< QAbstractButton*(*)>(_a[1]))); break;
        case 2: buttonPressed(); break;
        default: ;
        }
        _id -= 3;
    }
    return _id;
}
开发者ID:andersondeoliveiramachado,项目名称:camwhore,代码行数:16,代码来源:moc_WebcamWidget.cpp


示例12: updatePaddle1

void updatePaddle1(){

    //check for UP button press
    if (buttonPressed(64))
    {
        if (paddleY[1] > 10)
            paddleY[1] -= PADDLE_SPEED;
    }
    
    //check for DOWN button press
    if (buttonPressed(128))
    {
        if (paddleY[1] < SCREEN_H - PADDLE_HEIGHT - 1)
            paddleY[1] += PADDLE_SPEED;
    }
}
开发者ID:jduranmaster,项目名称:GBA-PingPong-Diplomacy,代码行数:16,代码来源:pingpong.c


示例13: QDialog

KGncPriceSourceDlg::KGncPriceSourceDlg(const QString &stockName, const QString& gncSource, QWidget * parent) : QDialog(parent), d(new Private)
{
  QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Help);
  QWidget *mainWidget = new QWidget(this);
  QVBoxLayout *mainLayout = new QVBoxLayout;
  setLayout(mainLayout);
  mainLayout->addWidget(mainWidget);
  QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
  okButton->setDefault(true);
  okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
  connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
  connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
  d->widget = new KGncPriceSourceDlgDecl();
  mainLayout->addWidget(d->widget);
  // signals and slots connections
  connect(d->widget->buttonsSource, SIGNAL(buttonClicked(int)), this, SLOT(buttonPressed(int)));
  connect(this, SIGNAL(helpClicked()), this, SLOT(slotHelp()));
  // initialize data fields
  d->widget->textStockName->setText(i18n("Investment: %1", stockName));
  d->widget->textGncSource->setText(i18n("Quote source: %1", gncSource));
  d->widget->listKnownSource->clear();
  d->widget->listKnownSource->insertItems(0, WebPriceQuote::quoteSources());
  d->widget->lineUserSource->setText(gncSource);
  d->widget->checkAlwaysUse->setChecked(true);
  d->widget->buttonsSource->setId(d->widget->buttonNoSource, 0);
  d->widget->buttonsSource->setId(d->widget->buttonSelectSource, 1);
  d->widget->buttonsSource->setId(d->widget->buttonUserSource, 2);
  d->widget->buttonsSource->button(0)->setChecked(true);
  mainLayout->addWidget(buttonBox);
  buttonPressed(0);
  return;
}
开发者ID:KDE,项目名称:kmymoney,代码行数:32,代码来源:kgncpricesourcedlg.cpp


示例14: repaint

void ToolBarButton::mouseReleaseEvent(QMouseEvent *event)
{
    event->accept(); // Event does not go to parent ToolBarWidget

    if (isToolButton()) {
        // Leave tool buttons pressed
    }
    else {
        // Lift other buttons back to up
        pressed = false;
        repaint();

        if (acceptMouseMove) {
            // User was only moving toolbar, do not open dialogs
            acceptMouseMove = false;
        }
        else {
            // Open dialogs
            // Send button pressed signal for dialog and undo/new buttons
            if (isDialogButton() || type == ToolBarButton::EUndo || type == ToolBarButton::ENew) {
                emit buttonPressed(type);
            }
        }
    }
}
开发者ID:deddu,项目名称:todoy_legacy,代码行数:25,代码来源:toolbarbutton.cpp


示例15: QWidget

AbstractEditableWidget::AbstractEditableWidget(QWidget *contentWidget, QWidget* parent)
:   QWidget(parent),
    m_contentWidget(contentWidget)
{
    m_layout = new QHBoxLayout(this);
    m_layout->setContentsMargins(0,0,0,0);

    m_label = new KSqueezedTextLabel(this);
    m_label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
    m_label->setTextElideMode(Qt::ElideRight);
    m_layout->addWidget(m_label);

    m_layout->addWidget(contentWidget);

    m_button = new QToolButton(this);
    m_button->setCheckable(false);
    //m_button->setIconSize(QSize(10,10));
    //m_button->setI (Qt::ToolButtonIconOnly);
    connect(m_button, SIGNAL(pressed()), this, SLOT(buttonPressed()));
    m_layout->addWidget(m_button);

    m_layout->addStretch();
    setLayout(m_layout);

    display();
}
开发者ID:sandsmark,项目名称:zanshin,代码行数:26,代码来源:editablewidget.cpp


示例16: QTimer

void Client::setup()
{
    authenticated = false;
    error = false;

    buttonTimeout = new QTimer(this);
    connect(buttonTimeout,SIGNAL(timeout()),this,SLOT(exhibitNumberEntered()));
    buttonTimeout->setSingleShot(true);

//    lcd = new LcdController();
    mediaPlayer = new MediaPlayer();
    keypad = new KeypadController();

    // must register own types or Qt wont connect them properly
    qRegisterMetaType<KeypadButton>("KeypadButton");

    QObject::connect(this, SIGNAL(getPin()), keypad, SLOT(pinRequested()));
    QObject::connect(keypad, SIGNAL(forwardButton(KeypadButton)), this, SLOT(buttonPressed(KeypadButton)));
    QObject::connect(keypad, SIGNAL(forwardPincode(QString)), this, SLOT(pincodeReceived(QString)));

    // network lives in a thread so hook up signals
    network = new Network();
    QObject::connect(this, SIGNAL(request(QUrl, QString)), network, SLOT(getRequest(QUrl, QString)));
    QObject::connect(network, SIGNAL(forwardMessage(QString, unsigned int)), this, SLOT(networkReply(QString, unsigned int)));

    // setup location tracker thread
    tracker = new LocationTracker();
    QObject::connect(tracker, SIGNAL(forwardNewLocation(int)), this, SLOT(locationChanged(int)));
}
开发者ID:james-dibble,项目名称:Embedded-Systems-Assignment,代码行数:29,代码来源:client.cpp


示例17: processEvents

void processEvents() {
	for(short i=1;i<=36;i++) {
		bool pressed = buttonPressed(i);
		if (lastButtons[i] != pressed) {performButtonAction(i, pressed);} //If changed, perform pressed or released action
		lastButtons[i] = pressed;
	}
	return;
}
开发者ID:cjgriscom,项目名称:4134-Toolkit,代码行数:8,代码来源:teleopV1.c


示例18: QToolButton

QToolButton* ToolHelper::createButton()
{
    QToolButton *but = new QToolButton();
    but->setIcon(KIcon(m_toolFactory->icon()).pixmap(22));
    but->setToolTip(m_toolFactory->toolTip());
    connect(but, SIGNAL(clicked()), this, SLOT(buttonPressed()));
    return but;
}
开发者ID:KDE,项目名称:koffice,代码行数:8,代码来源:KToolManager_p.cpp


示例19: Q_UNUSED

QWidget* Flags::createEditor(QWidget * parent, const QModelIndex & index)
{
	Q_UNUSED(index);
	QPushButton * bt = new QPushButton(parent);
	bt->setText(tr("Change flags"));
	connect(bt, SIGNAL(pressed()), this, SLOT(buttonPressed()));
	return bt;
}
开发者ID:Energid,项目名称:propertyeditor,代码行数:8,代码来源:flags.cpp


示例20: AbstractEditableWidget

EditableString::EditableString(QWidget* parent)
:   AbstractEditableWidget(new QLineEdit(), parent),
    m_lineEdit(static_cast<QLineEdit*>(m_contentWidget))
{
    m_contentWidget->setParent(this);
    connect(m_lineEdit, SIGNAL(returnPressed()), this, SLOT(buttonPressed()));

}
开发者ID:sandsmark,项目名称:zanshin,代码行数:8,代码来源:editablewidget.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ button_init函数代码示例发布时间:2022-05-30
下一篇:
C++ buttonClicked函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap