Exemplo n.º 1
0
int MainWidget::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: on_btnPause_clicked(); break;
        case 1: on_btnPlayPause_clicked(); break;
        case 2: on_btnSaveConfiguration_clicked(); break;
        case 3: on_sbHours_valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 4: on_sbHours_editingFinished(); break;
        case 5: on_cmbCompanies_currentIndexChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 6: on_cmbProjects_currentIndexChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 7: on_btnSave_clicked(); break;
        case 8: trayIconClicked((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        case 9: gotProjects((*reinterpret_cast< QList<Project>(*)>(_a[1]))); break;
        case 10: gotPerson((*reinterpret_cast< Person(*)>(_a[1]))); break;
        case 11: updateTime(); break;
        default: ;
        }
        _id -= 12;
    }
    return _id;
}
Exemplo n.º 2
0
NoteMgrForm::NoteMgrForm(Account *account, QWidget *parent) :
    QWidget(parent),ui(new Ui::NoteMgrForm),account(account)
{
    ui->setupUi(this);
    dbUtil = account->getDbUtil();
    ui->stackedWidget->setCurrentIndex(0);
    readNotes();
    connect(ui->lwTitles,SIGNAL(customContextMenuRequested(QPoint)),
            this,SLOT(titleListContextMenuRequested(QPoint)));
    sc_save = new QShortcut(QKeySequence("Ctrl+s"),this);
    connect(sc_save,SIGNAL(activated()),this,SLOT(on_btnSave_clicked()));
}
bool QFESPIMB040ScriptedAcquisition::maybeSave() {
    if (ui->edtScript->getEditor()->toPlainText().isEmpty()) return true;
    if (ui->edtScript->getEditor()->toPlainText()==lastScript) return true;
    int r=QMessageBox::question(this, tr("save acquisition script ..."), tr("The current script has not been saved.\n  Delete?\n    Yes: Any changes will be lost.\n    No: You will be asked for a filename for the script.\n    Cancel: return to editing the script."), QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel, QMessageBox::No);
    if (r==QMessageBox::Yes) {
        return true;
    } else if (r==QMessageBox::No) {
        on_btnSave_clicked();
        return true;
    }

    return false;
}
Exemplo n.º 4
0
void EditCardsDialog::closeEvent( QCloseEvent *event ) 
{
  switch( askForClosing() ) 
  {
  case QMessageBox::Save:
    event->ignore();
    on_btnSave_clicked();
    break;
  case QMessageBox::Discard:
    event->accept();
    break;
  case QMessageBox::Cancel:
  default:
    event->ignore();
  };
}
Exemplo n.º 5
0
void EditCardsDialog::keyPressEvent(QKeyEvent *e)
{
  if( e->key() != Qt::Key_Escape ) 
    QDialog::keyPressEvent(e);
  else
    switch( askForClosing() ) 
    {
    case QMessageBox::Save:
      e->ignore();
      on_btnSave_clicked();
      break;
    case QMessageBox::Discard:
      QDialog::keyPressEvent(e);
      break;
    case QMessageBox::Cancel:
    default:
      e->ignore();
    };  
}