void TrendReportFrame::initTreeTable() { strListHeights = ""; strListPans = ""; strListTitles = ""; // m_treePanelTable = new WSTreeAndPanTable(this); //AddJsParamToTable("treeviewPanel", m_treePanelTable->formName()); AddJsParam("treeviewPanel", m_treePanelTable->formName()); //TreeTable new WText("<div id='tree_panel' name='tree_panel' class='panel_tree'>", m_treePanelTable->elementAt(0, 0)); WTable * pTreeTable = new WTable(m_treePanelTable->elementAt(0, 0)); new WText(" ",pTreeTable->elementAt(0,0)); pTreeTable->elementAt(0,0)->setContentAlignment(AlignCenter | AlignTop); m_pTrendReportTree = new CCheckBoxTreeView((WTableCell*)pTreeTable->elementAt(0,0)); //new WText("<br>", m_pTrendReportTree->elementAt(0, 0)); if(m_pTrendReportTree) { string strSection = GetWebUserID(); m_pTrendReportTree->InitTree("", false, false, false, strSection); WObject::connect(m_pTrendReportTree, SIGNAL(ReportQueryRequest()), this, SLOT(ReportQueryResponse())); } m_pTrendReportTree->setStyleClass("viewtreebody"); new WText("</div>", pTreeTable->elementAt(0, 0)); //DragTable AddJsParam("drag_tree", m_treePanelTable->elementAt(0, 1)->formName()); //AddJsParamToTable("drag_tree", m_treePanelTable->elementAt(0, 1)->formName()); //PanTable new WText("<div id='view_panel' class='panel_view'>", m_treePanelTable->elementAt(0, 2)); m_pMainTable = new WSVMainTable(m_treePanelTable->elementAt(0, 2), strTrendTitle, true); if (m_pMainTable->pHelpImg) { connect(m_pMainTable->pHelpImg,SIGNAL(click()),this,SLOT(ShowHelp())); } initQueryTable(&m_pQueryTable, 1, "", m_pMainTable); new WText("</div>", m_treePanelTable->elementAt(0, 2)); }
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; }
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(); }
/*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))); }
//_______________________________________________________________________ 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 ); }
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())); }
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); } }
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; }
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()) ); }
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 }
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); }
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; }
// ---------------------------------------------------------------------------- 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); }
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; }
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); }
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; }
/// @brief constructor /// /// @param parent parent widget /// @param access to results ButtonTab::ButtonTab(QWidget *parent, ResultsTab *resultsTab) : QWidget(parent) , resultsTab (resultsTab) , testing (false) { button = new QPushButton("Click Me"); label = new QLabel("Click the buttons as fast as you can. Press SPACE to begin."); label->setVisible (true); label->setFont (QFont ("Arial", 18, QFont::Bold)); button->setFixedSize(80,30); button->setVisible (false); label->setParent (this); button->setParent (this); QRect r = parent->geometry (); width = r.right (); height = r.bottom (); label->move (width / 2, height / 2); button->move (width / 2, height / 2); button->setContextMenuPolicy (Qt::CustomContextMenu); connect(button, SIGNAL(clicked()), this, SLOT(click())); connect(button, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(click())); }
void BaseForm::initLogger(QCheckBox* w, QToolButton* c, QTreeWidget* o, QPlainTextEdit* d) { m_logger.init(o, w, d); connect(c, SIGNAL(released()), this, SLOT(clear())); connect(&m_logger, SIGNAL(clearLog()), this, SLOT(clear())); bindFocus(o, Qt::Key_F3); QShortcut* wr = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this); QShortcut* cl = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_D), this); QShortcut* sl = new QShortcut(QKeySequence(Qt::Key_F4), this); sl->setProperty(PROP_TARG, qVariantFromValue((void*)d)); connect(wr, SIGNAL(activated()), w, SLOT(click())); connect(sl, SIGNAL(activated()), this, SLOT(hotOutput())); connect(cl, SIGNAL(activated()), this, SLOT(clear())); connect(this, SIGNAL(output(const QString&)), &m_logger, SLOT(output(const QString&))); connect(this, SIGNAL(output(const QString&, const char*, quint32)), &m_logger, SLOT(output(const QString&, const char*, quint32))); }
HistoryWindow::HistoryWindow(const ChatUnit *unit) { ui.setupUi(this); ui.historyLog->setHtml("<p align='center'><span style='font-size:36pt;'>" + tr("No History") + "</span></p>"); ui.label_in->setText( tr( "In: %L1").arg( 0 ) ); ui.label_out->setText( tr( "Out: %L1").arg( 0 ) ); ui.label_all->setText( tr( "All: %L1").arg( 0 ) ); Shortcut *shortcut = new Shortcut("findNext", this); connect(shortcut, SIGNAL(activated()), ui.searchButton, SLOT(click())); shortcut = new Shortcut("findPrevious", this); connect(shortcut, SIGNAL(activated()), SLOT(findPrevious())); centerizeWidget(this); setAttribute(Qt::WA_QuitOnClose, false); setAttribute(Qt::WA_DeleteOnClose, true); QList<int> sizes; sizes.append(80); sizes.append(250); ui.splitter->setSizes(sizes); ui.splitter->setCollapsible(1,false); setIcons(); m_unitInfo = unit ? History::info(unit) : History::ContactInfo(); connect(ui.dateTreeWidget, &QTreeWidget::itemExpanded, this, &HistoryWindow::fillMonth); fillAccountComboBox(); setParent(QApplication::activeWindow()); setWindowFlags(windowFlags() | Qt::Window); QAction *action = new QAction(tr("Close"),this); connect(action, SIGNAL(triggered()), SLOT(close())); addAction(action); SystemIntegration::show(this); }
int MarkerSell::command (PluginData *pd) { int rc = 0; QStringList cl; cl << "type" << "info" << "highLow" << "move" << "click" << "create" << "settings"; switch (cl.indexOf(pd->command)) { case 0: // type pd->type = QString("marker"); rc = 1; break; case 1: // info rc = info(pd); break; case 2: // highLow rc = highLow(pd); break; case 3: // move rc = move(pd); break; case 4: // click rc = click(pd); break; case 5: // create rc = create(pd); break; case 6: // settings rc = settings(pd); break; default: break; } return rc; }
QFrame *CentralWidget::createBottomLeftPanel() { AnimatedButton *headlightsButton = new AnimatedButton(HEADLIGHTS_IMAGE_NORMAL, HEADLIGHTS_IMAGE_HOVERED, HEADLIGHTS_IMAGE_PRESSED); headlightsButton->setCheckable(true); connect(headlightsButton, SIGNAL(toggled(bool)), this, SLOT(slotHeadlightsStageChange(bool))); QShortcut *shortcut = new QShortcut(QKeySequence("F2"), headlightsButton); shortcut->setAutoRepeat(false); connect(shortcut, SIGNAL(activated()), headlightsButton, SLOT(click())); QVBoxLayout *bottomLeftPanelLayout = new QVBoxLayout; bottomLeftPanelLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); bottomLeftPanelLayout->addWidget(headlightsButton); QFrame *bottomLeftPanel = new QFrame; bottomLeftPanel->setLayout(bottomLeftPanelLayout); return bottomLeftPanel; }
InfoWidget::InfoWidget(QWidget *parent) : QWidget(parent) { label = new QLabel("Experiment gestartet"); button = new QPushButton("weiter"); centralWidget = new QWidget; vGroup = new QGroupBox; vlayout = new QVBoxLayout; vlayout->addWidget(label); vlayout->addWidget(button); vGroup->setLayout(vlayout); widgetlayout = new QVBoxLayout; //widgetlayout->addWidget(label); widgetlayout->addWidget(vGroup); centralWidget->setLayout(widgetlayout); this->setLayout(vlayout); QObject::connect(button, SIGNAL(clicked()), this, SLOT(click())); Logger::getInstance().log("infowidget added", 1); }
void checkBlink(int blinkStatus){ //Update the writer's eyes status switch (blinkStatus){ case 0: //Both open leftClose = false; rightClose = false; break; case 1: //Right close - left open if(leftClose) leftClose = false; if(!rightClose){ rightClose = true; click(); } forward = true; break; case 2: //Right open - left close if(!leftClose){ leftClose = true; forward = !forward; } if(rightClose){ rightClose = false; } break; case 3: //Both close leftClose = true; rightClose = true; break; } }
bool MgCmdDrawLines::touchEnded(const MgMotion* sender) { MgBaseLines* lines = (MgBaseLines*)m_shape->shape(); float closelen = mgLineHalfWidthModel(m_shape, sender) + mgDisplayMmToModel(5, sender); float closedist = sender->pointM.distanceTo(m_shape->shape()->getPoint(0)); bool closed = (m_step > 2 && closedist < closelen && m_shape->shape()->getExtent().width() > closedist * 1.5f && m_shape->shape()->getExtent().height() > closedist * 1.5f); if (m_step > 2 && m_shape->shape()->isClosed() != closed) { lines->setClosed(closed); if (closed) lines->removePoint(m_step); else lines->addPoint(sender->pointM); } if (!closed) { m_shape->shape()->setPoint(m_step, sender->pointM); if (m_step > 0 && !canAddPoint(sender, true)) lines->removePoint(m_step); } m_shape->shape()->update(); if (m_step > 1) { _addshape(sender); } else { click(sender); // add a point } m_shape->shape()->clear(); m_step = 0; return _touchEnded(sender); }
int LCDUI::getInt( char* pattern, int maxVal, int col, int row, int wrap ) { _lcd->cursor(); int num = 0; char buffer[33]; while ( !click() ) { int reading = (*_encoder).readNav(); num += reading; if ( wrap ) { if ( num < 0 ) { num = maxVal; } else if ( num > maxVal ) { num = 0; } } else { num = max( 0, min( maxVal, num ) ); } _lcd->setCursor( col, row ); int len = sprintf( buffer, pattern, num ); _lcd->print( buffer ); _lcd->setCursor( col+len-1, row ); } _lcd->cursor(); return num; }
bool EventNode::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) { if(getParent()){ if(!getParent()->isVisible()){ return false; } }else{ return false; } if(getParent()->getParent()){ if(!getParent()->getParent()->isVisible()){ return false; } } CCRect rect = CCRectMake(0, 0, getContentSize().width, getContentSize().height); CCPoint point = pTouch->getLocation(); point = this->convertToNodeSpace(point); if(rect.containsPoint(point)){ click(); return true; } return false; }
void ObjToggle::reset() { std::uint8_t def_state = default_state ? 1 : 0; if (def_state != count) { click(); } }
int main(int argc, char *argv[]) { if (argc < 2) { printf("Usage: %s <port>\n", argv[0]); return 0; } char port[sizeof(argv[1])]; strcpy(port, argv[1]); int debug = 0; if (argv[2] != NULL) { debug = 1; printf("Running in debug mode...\n"); } int server = 0; int x, y; struct addrinfo hints, *server_info; struct sockaddr_storage client_addr; int client_addr_length = sizeof(client_addr); Display *dpy; Window root_window; dpy = XOpenDisplay(0); memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; hints.ai_flags = AI_PASSIVE; getaddrinfo(NULL, port, &hints, &server_info); server = socket(server_info->ai_family, server_info->ai_socktype, server_info->ai_protocol); bind(server, server_info->ai_addr, server_info->ai_addrlen); printf("Listening on port: %s\n", port); char buffer[2]; while (*buffer != 0xFFFF) { recvfrom(server, buffer, sizeof(buffer), 0, (struct sockaddr *) &client_addr, &client_addr_length); if (debug) { printf("recvfrom: %d\n", *buffer); } x = buffer[0] & 127; y = buffer[1] & 127; if ((buffer[0] | 128) == buffer[0]) { x = 0 - x; } if ((buffer[1] | 128) == buffer[1]) { y = 0 - y; } if (x == 0 && y == 0) { click(dpy); } else { move(dpy, x, y); } if (debug) { printf("x: %d\ty: %d\n", x, y); } } close(server); return 0; }
int QAbstractButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: pressed(); break; case 1: released(); break; case 2: clicked((*reinterpret_cast< bool(*)>(_a[1]))); break; case 3: clicked(); break; case 4: toggled((*reinterpret_cast< bool(*)>(_a[1]))); break; case 5: setIconSize((*reinterpret_cast< const QSize(*)>(_a[1]))); break; case 6: animateClick((*reinterpret_cast< int(*)>(_a[1]))); break; case 7: animateClick(); break; case 8: click(); break; case 9: toggle(); break; case 10: setChecked((*reinterpret_cast< bool(*)>(_a[1]))); break; case 11: setOn((*reinterpret_cast< bool(*)>(_a[1]))); break; } _id -= 12; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = text(); break; case 1: *reinterpret_cast< QIcon*>(_v) = icon(); break; case 2: *reinterpret_cast< QSize*>(_v) = iconSize(); break; case 3: *reinterpret_cast< QKeySequence*>(_v) = shortcut(); break; case 4: *reinterpret_cast< bool*>(_v) = isCheckable(); break; case 5: *reinterpret_cast< bool*>(_v) = isChecked(); break; case 6: *reinterpret_cast< bool*>(_v) = autoRepeat(); break; case 7: *reinterpret_cast< bool*>(_v) = autoExclusive(); break; case 8: *reinterpret_cast< int*>(_v) = autoRepeatDelay(); break; case 9: *reinterpret_cast< int*>(_v) = autoRepeatInterval(); break; case 10: *reinterpret_cast< bool*>(_v) = isDown(); break; } _id -= 11; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setText(*reinterpret_cast< QString*>(_v)); break; case 1: setIcon(*reinterpret_cast< QIcon*>(_v)); break; case 2: setIconSize(*reinterpret_cast< QSize*>(_v)); break; case 3: setShortcut(*reinterpret_cast< QKeySequence*>(_v)); break; case 4: setCheckable(*reinterpret_cast< bool*>(_v)); break; case 5: setChecked(*reinterpret_cast< bool*>(_v)); break; case 6: setAutoRepeat(*reinterpret_cast< bool*>(_v)); break; case 7: setAutoExclusive(*reinterpret_cast< bool*>(_v)); break; case 8: setAutoRepeatDelay(*reinterpret_cast< int*>(_v)); break; case 9: setAutoRepeatInterval(*reinterpret_cast< int*>(_v)); break; case 10: setDown(*reinterpret_cast< bool*>(_v)); break; } _id -= 11; } else if (_c == QMetaObject::ResetProperty) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyDesignable) { bool *_b = reinterpret_cast<bool*>(_a[0]); switch (_id) { case 5: *_b = isCheckable(); break; } _id -= 11; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 11; } #endif // QT_NO_PROPERTIES return _id; }
static void kbd_defaults(int kbd) { scf_handle_t *h = NULL; scf_snapshot_t *snap = NULL; scf_instance_t *inst = NULL; scf_propertygroup_t *pg = NULL; scf_property_t *prop = NULL; scf_value_t *val = NULL; int layout_num; char *val_layout = NULL, *val_abort = NULL; uint8_t val_click; int64_t val_delay, val_rate; int64_t val_kbd_beeper, val_console_beeper; if ((h = scf_handle_create(SCF_VERSION)) == NULL || scf_handle_bind(h) != 0 || (inst = scf_instance_create(h)) == NULL || (snap = scf_snapshot_create(h)) == NULL || (pg = scf_pg_create(h)) == NULL || (prop = scf_property_create(h)) == NULL || (val = scf_value_create(h)) == NULL) { goto out; } if (scf_handle_decode_fmri(h, KBD_FMRI, NULL, NULL, inst, NULL, NULL, SCF_DECODE_FMRI_REQUIRE_INSTANCE) != 0) { goto out; } if (scf_instance_get_snapshot(inst, "running", snap) != 0) { scf_snapshot_destroy(snap); snap = NULL; } if (scf_instance_get_pg_composed(inst, snap, KBD_PG, pg) != 0) { goto out; } if ((val_abort = malloc(KBD_MAX_NAME_LEN)) == NULL) { (void) fprintf(stderr, "Can not alloc memory for keyboard properties\n"); goto out; } if ((val_layout = malloc(KBD_MAX_NAME_LEN)) == NULL) { (void) fprintf(stderr, "Can not alloc memory for keyboard properties\n"); goto out; } if (scf_pg_get_property(pg, KBD_PROP_KEYCLICK, prop) != 0 || scf_property_get_value(prop, val) != 0 || scf_value_get_boolean(val, &val_click) == -1) { (void) fprintf(stderr, "Can not get KEYCLICK\n"); } if (val_click == 1) (void) click("on", kbd); else if (val_click == 0) (void) click("off", kbd); else (void) fprintf(stderr, BAD_DEFAULT_INT, KBD_PROP_KEYCLICK, val_click); if (scf_pg_get_property(pg, KBD_PROP_KEYBOARD_ABORT, prop) != 0 || scf_property_get_value(prop, val) != 0 || scf_value_get_astring(val, val_abort, KBD_MAX_NAME_LEN) == -1) { (void) fprintf(stderr, "Can not get KEYBOARD_ABORT\n"); } if (*val_abort != '\0') { /* * ABORT must equal "enable", "disable" or "alternate" */ if ((strcmp(val_abort, "enable") == 0) || (strcmp(val_abort, "alternate") == 0) || (strcmp(val_abort, "disable") == 0)) (void) abort_enable(val_abort, kbd); else (void) fprintf(stderr, BAD_DEFAULT_STR, KBD_PROP_KEYBOARD_ABORT, val_abort); } if (scf_pg_get_property(pg, KBD_PROP_RPTDELAY, prop) != 0 || scf_property_get_value(prop, val) != 0 || scf_value_get_integer(val, &val_delay) == -1) { (void) fprintf(stderr, "Can not get RPTDELAY\n"); } if (val_delay > 0) (void) set_rptdelay(val_delay, kbd); else (void) fprintf(stderr, BAD_DEFAULT_LLINT, KBD_PROP_RPTDELAY, val_delay); if (scf_pg_get_property(pg, KBD_PROP_RPTRATE, prop) != 0 || scf_property_get_value(prop, val) != 0 || scf_value_get_integer(val, &val_rate) == -1) { (void) fprintf(stderr, "Can not get RPTRATE\n"); } if (val_rate > 0) (void) set_rptrate(val_rate, kbd); else (void) fprintf(stderr, BAD_DEFAULT_LLINT, KBD_PROP_RPTRATE, val_rate); if (scf_pg_get_property(pg, KBD_PROP_LAYOUT, prop) != 0 || scf_property_get_value(prop, val) != 0 || scf_value_get_astring(val, val_layout, KBD_MAX_NAME_LEN) == -1) { (void) fprintf(stderr, "Can not get LAYOUT\n"); } if (*val_layout != '\0') { /* * LAYOUT must be one of the layouts supported in kbd_layouts */ if (get_layouts() != 0) goto out; if ((layout_num = get_layout_number(val_layout)) == -1) { (void) fprintf(stderr, BAD_DEFAULT_STR, KBD_PROP_LAYOUT, val_layout); goto out; } (void) set_layout(kbd, layout_num); } if (scf_pg_get_property(pg, KBD_PROP_FREQ, prop) != 0 || scf_property_get_value(prop, val) != 0 || scf_value_get_integer(val, &val_kbd_beeper) == -1) { (void) fprintf(stderr, "Can not get FREQ\n"); } if (val_kbd_beeper >= 0 && val_kbd_beeper <= INT16_MAX) (void) set_beep_freq(kbd, "keyboard", val_kbd_beeper); else (void) fprintf(stderr, BAD_DEFAULT_LLINT, KBD_PROP_FREQ, val_kbd_beeper); if (scf_pg_get_property(pg, KBD_PROP_CONSFREQ, prop) != 0 || scf_property_get_value(prop, val) != 0 || scf_value_get_integer(val, &val_console_beeper) == -1) { (void) fprintf(stderr, "Can not get CONSFREQ\n"); } if (val_console_beeper >= 0 && val_console_beeper <= INT16_MAX) (void) set_beep_freq(kbd, "console", val_console_beeper); else (void) fprintf(stderr, BAD_DEFAULT_LLINT, KBD_PROP_CONSFREQ, val_console_beeper); out: if (val_layout != NULL) free(val_layout); if (val_abort != NULL) free(val_abort); if (snap != NULL) scf_snapshot_destroy(snap); scf_value_destroy(val); scf_property_destroy(prop); scf_pg_destroy(pg); scf_instance_destroy(inst); scf_handle_destroy(h); }