当前位置: 首页>>代码示例>>C++>>正文


C++ click函数代码示例

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


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

示例1: QMessageBoxHelper

QPlatformDialogHelper *QQuickQMessageBox::helper()
{
    QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
    if (parentItem)
        m_parentWindow = parentItem->window();

    if (!QQuickAbstractMessageDialog::m_dlgHelper) {
        QMessageBoxHelper* helper = new QMessageBoxHelper();
        QQuickAbstractMessageDialog::m_dlgHelper = helper;
        // accept() shouldn't be emitted.  reject() happens only if the dialog is
        // dismissed by closing the window rather than by one of its button widgets.
        connect(helper, SIGNAL(accept()), this, SLOT(accept()));
        connect(helper, SIGNAL(reject()), this, SLOT(reject()));
        connect(helper, SIGNAL(clicked(QPlatformDialogHelper::StandardButton,QPlatformDialogHelper::ButtonRole)),
            this, SLOT(click(QPlatformDialogHelper::StandardButton,QPlatformDialogHelper::ButtonRole)));
    }

    return QQuickAbstractMessageDialog::m_dlgHelper;
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:19,代码来源:qquickqmessagebox.cpp

示例2: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
// Загружаем интерфейс пользователя из формы и устанавливаем действия в меню
    ui->setupUi(this);
    connect(ui->action_start, SIGNAL(triggered()), ui->startButton, SLOT(click()));
    connect(ui->action_exit, SIGNAL(triggered()), this, SLOT(close()));
    connect(ui->action_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    connect(ui->action_help, SIGNAL(triggered()), this, SLOT(showHelp()));
    connect(ui->action_about, SIGNAL(triggered()), this, SLOT(showAbout()));
    connect(ui->action_tech, SIGNAL(triggered()), this, SLOT(showTz()));
// Заводим машину состояний
    QStateMachine *animation = new QStateMachine(this);
    QState *idle = new QState();
    QState *animating = new QState();
    animating->assignProperty(ui->startButton,"text", tr("&Стоп"));
    animating->assignProperty(ui->startButton,"icon", QIcon(":/icons/control-stop-square.png"));
    animating->assignProperty(ui->action_start,"text",tr("О&становить анимацию"));
    animating->assignProperty(ui->action_start,"icon", QIcon(":/icons/control-stop-square.png"));
    idle->assignProperty(ui->startButton,"text", tr("Пу&ск"));
    idle->assignProperty(ui->startButton,"icon", QIcon(":/icons/control.png"));
    idle->assignProperty(ui->action_start,"text",tr("Запу&стить анимацию"));
    idle->assignProperty(ui->action_start,"icon", QIcon(":/icons/control.png"));
    QSignalTransition *startTransition = new QSignalTransition(ui->startButton, SIGNAL(clicked()), idle);
    startTransition->setTargetState(animating);
    QSignalTransition *stopTransition = new QSignalTransition(ui->startButton, SIGNAL(clicked()), animating);
    stopTransition->setTargetState(idle);
    QSignalTransition *doneTransition = new QSignalTransition(ui->widget, SIGNAL(animationStopped()), animating);
    doneTransition->setTargetState(idle);
    connect(startTransition, SIGNAL(triggered()), ui->widget, SLOT(startAnimation()));
    connect(stopTransition, SIGNAL(triggered()), ui->widget, SLOT(stopAnimation()));
    idle->addTransition(startTransition);
    animating->addTransition(stopTransition);
    animating->addTransition(doneTransition);
    animation->addState(idle);
    animation->addState(animating);
    animation->setInitialState(idle);
    animation->start();
 // В Linux мячик иногда сразу не отображается...
    ui->widget->updateGL();
}
开发者ID:Envek,项目名称:ECGKW,代码行数:42,代码来源:mainwindow.cpp

示例3: QWidget

/*SEARCH ENGINE START*/
SearchEngine::SearchEngine(MainWindow* parent)
  : QWidget(parent)
  , search_pattern(new LineEdit)
  , mp_mainWindow(parent)
{
  setupUi(this);
  searchBarLayout->insertWidget(0, search_pattern);
  connect(search_pattern, SIGNAL(returnPressed()), search_button, SLOT(click()));
  // Icons
  search_button->setIcon(IconProvider::instance()->getIcon("edit-find"));
  download_button->setIcon(IconProvider::instance()->getIcon("download"));
  goToDescBtn->setIcon(IconProvider::instance()->getIcon("application-x-mswinurl"));
  enginesButton->setIcon(IconProvider::instance()->getIcon("preferences-system-network"));
  tabWidget->setTabsClosable(true);
  connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
  // Boolean initialization
  search_stopped = false;
  // Creating Search Process
#ifdef Q_WS_WIN
  has_python = addPythonPathToEnv();
#endif
  searchProcess = new QProcess(this);
  searchProcess->setEnvironment(QProcess::systemEnvironment());
  connect(searchProcess, SIGNAL(started()), this, SLOT(searchStarted()));
  connect(searchProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readSearchOutput()));
  connect(searchProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(searchFinished(int,QProcess::ExitStatus)));
  connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tab_changed(int)));
  searchTimeout = new QTimer(this);
  searchTimeout->setSingleShot(true);
  connect(searchTimeout, SIGNAL(timeout()), this, SLOT(on_search_button_clicked()));
  // Update nova.py search plugin if necessary
  updateNova();
  supported_engines = new SupportedEngines(
      #ifdef Q_WS_WIN
        has_python
      #endif
        );
  // Fill in category combobox
  fillCatCombobox();

  connect(search_pattern, SIGNAL(textEdited(QString)), this, SLOT(searchTextEdited(QString)));
}
开发者ID:SpectreXR6,项目名称:qBittorrent,代码行数:43,代码来源:searchengine.cpp

示例4: if

    //_______________________________________________________________________
    void Simulator::click( QWidget* receiver, int delay  )
    {

        QPoint position;
        if( QCheckBox* checkbox = qobject_cast<QCheckBox*>( receiver ) )
        {

            QStyleOptionButton option;
            option.initFrom( checkbox );
            position = checkbox->style()->subElementRect(
                QStyle::SE_CheckBoxIndicator,
                &option,
                checkbox).center();

        } else if( QRadioButton* radiobutton = qobject_cast<QRadioButton*>( receiver ) ) {

            QStyleOptionButton option;
            option.initFrom( radiobutton );
            position = radiobutton->style()->subElementRect(
                QStyle::SE_RadioButtonIndicator,
                &option,
                radiobutton).center();

        } else if( const QMdiSubWindow* window = qobject_cast<QMdiSubWindow*>( receiver ) ) {

            QStyleOptionTitleBar option;
            option.initFrom( window );
            int titleBarHeight( window->style()->pixelMetric( QStyle::PM_TitleBarHeight, &option, window ) );
            QRect titleBarRect( QPoint(0,0), QSize( window->width(), titleBarHeight ) );
            if( !titleBarRect.isValid() ) return;
            position = titleBarRect.center();

        } else {

            position = receiver->rect().center();

        }

        click( receiver, position, delay );

    }
开发者ID:KDE,项目名称:kde-workspace,代码行数:42,代码来源:oxygensimulator.cpp

示例5: QMainWindow

WidgetChatInput::WidgetChatInput(QWidget *parent, bool isIRC) :
	QMainWindow(parent),
	ui(new Ui::WidgetChatInput)
{
	ui->setupUi(this);
	bIsIRC = isIRC;
	textEditInput = new WidgetReturnEmitTextEdit(this);
	connect(textEditInput, SIGNAL(cursorPositionChanged()), this, SLOT(updateToolbar()));
	ui->horizontalLayoutInput->addWidget(textEditInput);
	checkBoxSendOnEnter = new QCheckBox(tr("Send On Enter"), this);
	checkBoxSendOnEnter->setChecked(true);
	connect(checkBoxSendOnEnter, SIGNAL(toggled(bool)), textEditInput, SLOT(setEmitsReturn(bool)));
	connect(textEditInput, SIGNAL(returnPressed()), ui->toolButtonSend, SLOT(click()));
	connect(textEditInput, SIGNAL(currentCharFormatChanged(QTextCharFormat)), this, SLOT(onTextFormatChange(QTextCharFormat)));
	toolButtonSmilies = new QToolButton();
	toolButtonSmilies->setPopupMode(QToolButton::InstantPopup);
	toolButtonSmilies->setToolTip(tr("Smilies"));
	toolButtonSmilies->setIcon(QIcon(":/Resource/Smileys/0.png"));
	widgetSmileyList = new WidgetSmileyList(this);
	toolButtonSmilies->setMenu(widgetSmileyList);
	toolButtonPickColor = new QToolButton(this);
	toolButtonPickColor->setStyleSheet(QString("QToolButton { background-color: %1; border-style: outset; border-width: 2px;	border-radius: 6px; border-color: lightgrey; }").arg(textEditInput->textColor().name()));
	toolButtonPickColor->setToolTip(tr("Font Color"));
	connect(toolButtonPickColor, SIGNAL(clicked()), this, SLOT(pickColor()));
	toolButtonPrivateMessage = new QToolButton(this);
	toolButtonPrivateMessage->setText(tr("New Private Message"));
	toolButtonPrivateMessage->setToolTip(tr("New Private Message"));
	toolButtonPrivateMessage->setIcon(QIcon(":/Resource/Chat/Chat.png"));
	ui->toolBarTextTools->insertWidget(ui->actionBold, toolButtonPickColor);
	ui->toolBarTextTools->addSeparator();
	ui->toolBarTextTools->addWidget(toolButtonSmilies);
	ui->toolBarTextTools->addWidget(checkBoxSendOnEnter);
	ui->actionBold->setChecked(textEditInput->fontWeight() == QFont::Bold);
	ui->actionItalic->setChecked(textEditInput->fontItalic());
	ui->actionUnderline->setChecked(textEditInput->fontUnderline());
	ui->toolBarTextTools->addWidget(toolButtonPrivateMessage);
	toolButtonPrivateMessage->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
	connect(ui->actionItalic, SIGNAL(toggled(bool)), textEditInput, SLOT(setFontItalic(bool)));
	connect(ui->actionUnderline, SIGNAL(toggled(bool)), textEditInput, SLOT(setFontUnderline(bool)));
	connect(toolButtonPrivateMessage, SIGNAL(clicked()), this, SLOT(addPrivateMessage()));
}
开发者ID:BackupTheBerlios,项目名称:quazaa-svn,代码行数:41,代码来源:widgetchatinput.cpp

示例6: stopRecorting

void MainWindow::startReplay()
{
    stopRecorting();

//    m_replayTimer.setInterval(500);
//    m_replayTimer.start();
//    connect(&m_replayTimer, &QTimer::timeout, this, &MainWindow::replayEvent);

    for(int i = 0; i < m_events.count(); ++i)
    {
        Sleep(m_frequenz);
        Event event = m_events[i];
        setPos(event.pos);
        Sleep(1);
        if(event.click)
            click();

        auto index = m_model.index(i, 0);
        ui->listView->setCurrentIndex(index);
    }
}
开发者ID:AndreyMlashkin,项目名称:WindowsClicker,代码行数:21,代码来源:mainwindow.cpp

示例7: main

int main(int argc, char *argv[]) {
    Image<byte> I;
    Image<float> Vx, Vy;
    if (!load(I, argc > 1 ? argv[1] : srcPath("salon.png"))) {
        cout << "Echec de lecture d'image" << endl;
        return 1;
    }

    openWindow(I.width(), I.height());
    display(I);
    click();
    cout << "Contraste simple" << endl;
    affiche(I);
    gradient(I, Vx, Vy);
    click();
    cout << "Dérivée selon x par la fonction gradient" <<endl;
    affiche(Vx);
    click();
    cout << "Dérivée selon y par la fonction gradient" <<endl;
    affiche(Vy);

    click();

    Image<float> F = dx(I);

    cout << "Dérivée selon x par la fonction dx" <<endl;

    affiche(F);

    click();

    Image<float> U= dy(I);
    cout << "Dérivée selon y par la fonction dy" <<endl;

    affiche(U);

    click();

    masque(I,F,U);

    Image<float> z = poisson(F,U);
    cout << "Image reconstruite par poisson" <<endl;

    affiche(z);

    endGraphics();
    return 0;
}
开发者ID:ClementRiu,项目名称:Poisson,代码行数:48,代码来源:contrastePoisson.cpp

示例8: QWidget

ChatWindow::ChatWindow( QString myName, ConnectionObject* connection, QWidget* parent)
    : QWidget(parent),
      m_myName(myName),
      m_chatConnection(connection)      
{
  if( m_chatConnection->getName() == "" ){
    m_conName = QString(m_chatConnection->getIp() + ":" + QString::number(m_chatConnection->getClientPort()) );
  } else {
    m_conName = m_chatConnection->getName();
  }
  setWindowTitle(QString("Chat: %1 - KLan").arg(m_conName));
  setupGui();
  
  m_tableFormat = new QTextTableFormat();
  m_tableFormat->setBorder(0);
  
  connect( m_sendBtn, SIGNAL(clicked()), this, SLOT(sendMessage()) );
  connect( m_messageEdit, SIGNAL(returnPressed()), m_sendBtn, SLOT(click()) );
  connect( m_chatConnection, SIGNAL(sigChange(ConnectionObject*)), this, SLOT(connectionChanged()) );
  connect( m_chatConnection, SIGNAL(destroyed()), this, SLOT(connectionDestroyed()) );
}
开发者ID:Fxrh,项目名称:KLan,代码行数:21,代码来源:chatwindow.cpp

示例9: connect

void PlaylistEdit::createConnections()
{
    connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(aboutTano()));
    connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(settings()));
    connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(open()));
    connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(newPlaylist()));
    connect(ui->actionDelete, SIGNAL(triggered()), this, SLOT(deleteItem()));
    connect(ui->actionAdd, SIGNAL(triggered()), this, SLOT(addItem()));
    connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(save()));
    connect(ui->actionClose, SIGNAL(triggered()), this, SLOT(exit()));
    connect(ui->actionExport, SIGNAL(triggered()), this, SLOT(menuOpenExport()));
    connect(ui->actionExportTvheadend, SIGNAL(triggered()), this, SLOT(exportTvheadend()));
    connect(ui->actionExportXmltvId, SIGNAL(triggered()), this, SLOT(exportXmltvId()));
    connect(ui->actionPrint, SIGNAL(triggered()), this, SLOT(print()));

    connect(ui->editName, SIGNAL(textChanged(QString)), this, SLOT(setTitle(QString)));

    connect(ui->buttonApplyNum, SIGNAL(clicked()), this, SLOT(editChannelNumber()));
    connect(ui->editNumber, SIGNAL(returnPressed()), ui->buttonApplyNum, SLOT(click()));
    connect(ui->editChannelName, SIGNAL(textChanged(QString)), this, SLOT(editChannelName(QString)));
    connect(ui->editUrl, SIGNAL(textChanged(QString)), this, SLOT(editChannelUrl(QString)));
    connect(ui->editCategories, SIGNAL(textChanged(QString)), this, SLOT(editChannelCategories(QString)));
    connect(ui->editLanguage, SIGNAL(textChanged(QString)), this, SLOT(editChannelLanguage(QString)));
    connect(ui->editEpg, SIGNAL(textChanged(QString)), this, SLOT(editChannelEpg(QString)));
    connect(ui->editLogo, SIGNAL(textChanged(QString)), this, SLOT(editChannelLogo(QString)));

    connect(ui->actionUp, SIGNAL(triggered()), this, SLOT(moveUp()));
    connect(ui->actionDown, SIGNAL(triggered()), this, SLOT(moveDown()));

    connect(ui->playlist, SIGNAL(itemSelected(Channel *)), this, SLOT(editItem(Channel *)));

#if EDITOR
    connect(_update, SIGNAL(newUpdate()), this, SLOT(updateAvailable()));
    connect(ui->actionUpdate, SIGNAL(triggered()), _update, SLOT(check()));
#endif

#if WITH_EDITOR_VLCQT
    connect(ui->buttonUpdate, SIGNAL(toggled(bool)), this, SLOT(refreshPlaylist(bool)));
#endif
}
开发者ID:RaoulVolfoni,项目名称:tano,代码行数:40,代码来源:PlaylistEdit.cpp

示例10: tol

bool MgCmdDrawSplines::touchEnded(const MgMotion* sender)
{
    MgSplines* lines = (MgSplines*)dynshape()->shape();
    
    if (m_freehand) {
        Tol tol(sender->displayMmToModel(1.f));
        if (m_step > 0 && !dynshape()->shape()->getExtent().isEmpty(tol, false)) {
            MgShape* newsp = addShape(sender);
            if (newsp) {/*
                m_step = 0;
                sender->view->regenAppend(0);
                newsp = newsp->cloneShape();
                lines = (MgSplines*)newsp->shape();
                lines->smooth(sender->view->xform()->modelToDisplay(),
                              sender->view->xform()->getWorldToDisplayY() * 0.5f);
                sender->view->shapes()->updateShape(newsp);
                sender->view->regenAppend(newsp->getID())*/
            }
        }
        else {
            click(sender);  // add a point
        }
        m_step = 0;
    }
    else {
        float dist = lines->endPoint().distanceTo(dynshape()->shape()->getPoint(0));

        while (m_step > 1 && dist < sender->displayMmToModel(1.f)) {
            lines->setClosed(true);
            lines->removePoint(m_step--);
            dist = lines->endPoint().distanceTo(dynshape()->shape()->getPoint(0));
        }
        if (m_step > 1 && lines->isClosed()) {
            addShape(sender);
            m_step = 0;
        }
    }
    
    return MgCommandDraw::touchEnded(sender);
}
开发者ID:CharlyZhang,项目名称:vgcore,代码行数:40,代码来源:mgdrawsplines.cpp

示例11: usePlatformNativeDialog

QPlatformMessageDialogHelper *QQuickPlatformMessageDialog::helper()
{
    QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
    if (parentItem)
        m_parentWindow = parentItem->window();

    if ( !m_dlgHelper && QGuiApplicationPrivate::platformTheme()->
            usePlatformNativeDialog(QPlatformTheme::MessageDialog) ) {
        m_dlgHelper = static_cast<QPlatformMessageDialogHelper *>(QGuiApplicationPrivate::platformTheme()
           ->createPlatformDialogHelper(QPlatformTheme::MessageDialog));
        if (!m_dlgHelper)
            return m_dlgHelper;
        // accept() shouldn't be emitted.  reject() happens only if the dialog is
        // dismissed by closing the window rather than by one of its button widgets.
        connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
        connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
        connect(m_dlgHelper, SIGNAL(clicked(QPlatformDialogHelper::StandardButton,QPlatformDialogHelper::ButtonRole)),
            this, SLOT(click(QPlatformDialogHelper::StandardButton,QPlatformDialogHelper::ButtonRole)));
    }

    return m_dlgHelper;
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:22,代码来源:qquickplatformmessagedialog.cpp

示例12: QFETCH

// ----------------------------------------------------------------------------
void ctkMessageBoxDontShowAgainTester::testExecMessageBox(ctkMessageBox& messageBox)
{
  QFETCH(int, buttonOrRole);
  if (buttonOrRole != QMessageBox::InvalidRole)
    {
    if (messageBox.standardButtons() == QMessageBox::NoButton &&
        messageBox.buttons().size() == 0)
      {
      messageBox.addButton(QMessageBox::Ok);
      }
    if (messageBox.standardButtons() & buttonOrRole)
      {
      QAbstractButton* button = messageBox.button(
        static_cast<QMessageBox::StandardButton>(buttonOrRole));
      QVERIFY(button);
      QTimer::singleShot(0, button, SLOT(click()));
      }
    else
      {
      const char* slot = 0;
      if (buttonOrRole == QMessageBox::AcceptRole)
        {
        slot = SLOT(accept());
        }
      else if (buttonOrRole == QMessageBox::RejectRole)
        {
        slot = SLOT(reject());
        }
      QTimer::singleShot(0, &messageBox, slot);
      }
    }
  // shouldn't hang
  int execResult = messageBox.exec();
  QFETCH(int, result);
  QCOMPARE(execResult, result);

  QFETCH(QMessageBox::ButtonRole, resultRole);
  QCOMPARE(messageBox.buttonRole(messageBox.clickedButton()), resultRole);
}
开发者ID:151706061,项目名称:CTK,代码行数:40,代码来源:ctkMessageBoxDontShowAgainTest.cpp

示例13: while

int LCDUI::cursorMenu( int locs[][2], int count, int pos ) {
    _lcd->cursor();
    _lcd->blink();

    while ( !click() ) {
        _lcd->setCursor( locs[pos][0], locs[pos][1] );
        int8_t reading = (*_encoder).readNav();
        if ( reading ) {
            pos += reading;
            if ( pos < 0 ) {
                pos = count - 1;
            } else if ( pos >= count ) {
                pos = 0;
            }
        }
    }

    _lcd->noCursor();
    _lcd->noBlink();

    return pos;
}
开发者ID:dloocke,项目名称:LCDUI,代码行数:22,代码来源:LCDUI.cpp

示例14: tr

void
SettingsDialog::enableRoutineCommand(bool checked)
{
    //Show annoying warning to scare the user
    if (checked && QMessageBox::warning(this,
        tr("Custom change command selected"),
        tr(
        "You have chosen to use a custom change command. "
        "This command will be executed everytime the wallpaper is changed. "
        "So be careful what you type in there."),
        QMessageBox::Ok | QMessageBox::Cancel,
        QMessageBox::Ok) != QMessageBox::Ok)
    {
        //We scared the user, got back to automatic
        QTimer::singleShot(0, opt_auto, SLOT(click()));
        return;
    }

    new_routine = "command";
    txt_command->setEnabled(true);

}
开发者ID:c0xc,项目名称:Wallphiller,代码行数:22,代码来源:settingsdialog.cpp

示例15: click

void ADraggableMoveTile::RemoveFocus()
{
	bool isClick = mousePressTimer <= mouseClickTime && mousePressTimer > 0.0f;
	if (isClick)
	{
		click();
	}

	isSelected = false;

	bool canMove = canSnap && !destinationOccupied && goalVertex != nullptr;
	if (canMove)
	{
		isMoving = true;
		currentVertex->SetOccupied(false);
		goalVertex->SetOccupied(true);
		currentVertex = goalVertex;
		goalVertex = nullptr;
	}

	mousePressTimer = 0.0f;
}
开发者ID:pokelege,项目名称:ProjectTap_Code,代码行数:22,代码来源:DraggableMoveTile.cpp


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