예제 #1
0
void DlgPreferences::addPageWidget(DlgPreferencePage* pWidget) {
    connect(this, SIGNAL(showDlg()),
            pWidget, SLOT(slotShow()));
    connect(this, SIGNAL(closeDlg()),
            pWidget, SLOT(slotHide()));
    connect(this, SIGNAL(showDlg()),
            pWidget, SLOT(slotUpdate()));

    connect(this, SIGNAL(applyPreferences()),
            pWidget, SLOT(slotApply()));
    connect(this, SIGNAL(cancelPreferences()),
            pWidget, SLOT(slotCancel()));
    connect(this, SIGNAL(resetToDefaults()),
            pWidget, SLOT(slotResetToDefaults()));

    QScrollArea* sa = new QScrollArea(pagesWidget);
    sa->setWidgetResizable(true);

    sa->setWidget(pWidget);
    pagesWidget->addWidget(sa);

    int iframe = 2 * sa->frameWidth();
    m_pageSizeHint = m_pageSizeHint.expandedTo(
            pWidget->sizeHint()+QSize(iframe, iframe));

}
예제 #2
0
void BrowsePicture::AutoMergeButtonClicked()
{
  pic_path = ui.dir_edit->text();
  if(!ReadFile(pic_path))
  {
    return;
  }
  clearDir(pic_path);
  MyAutoMergeThread *automerge = new MyAutoMergeThread;
  automerge->setArg(arg);
  automerge->setPath(pic_path);
  connect(automerge,SIGNAL(done()),this,SLOT(doneSuccess()));
  connect(automerge,SIGNAL(fail()),this,SLOT(doneFail()));
  connect(automerge,SIGNAL(showpic(QString)),this,SLOT(ShowDonePicture(QString)));
  connect(automerge,SIGNAL(showDoingPic(QString)),this,SLOT(ShowThumbnail(QString)));

  Progress *dlg = new Progress;
  dlg->setFlag(1);
  dlg->setPathName(pic_path);
  dlg->setArg(arg);
  dlg->setProgressMax();
  dlg->setAutoMergeThread(automerge);
  dlg->show();
  connect(automerge,SIGNAL(done()),dlg,SLOT(closeDlg()));
  automergethread_list.append(automerge);
  automergeprogress_list.append(dlg);
  automerge->start();
}
예제 #3
0
progressDialog::progressDialog(QWidget *parent, Qt::WFlags flags)
    : QMainWindow(parent, flags){

    ui.setupUi(this);

    Consumer *c = new Consumer();
    Producer *p = new Producer();

    Thread *t1 = new Thread(0);
    Thread *t2 = new Thread(0);

    connect(this,SIGNAL(begin(bool)),c,SLOT(startReceiving(bool)));
    connect(c,SIGNAL(initiate(bool)),p,SLOT(produce(bool)));
    connect(p,SIGNAL(sendPacket(const QByteArray,bool)),c,SLOT(receiveFrame(const QByteArray,bool)));
    connect(ui.pushButton,SIGNAL(clicked(bool)),this,SLOT(_begin(bool)));
    connect(p,SIGNAL(halt(bool)),c,SLOT(startReceiving(bool)));
	connect(c,SIGNAL(blockDone()),p,SLOT(frameData()));
	connect(c,SIGNAL(measure(bool)),p,SLOT(measurement(bool)),Qt::DirectConnection);
	connect(c,SIGNAL(openDialog()),this,SLOT(startDlg()));
	connect(c,SIGNAL(closeDialog()),this,SLOT(closeDlg()));
	connect(p,SIGNAL(setDlgMax(int)),this,SLOT(setMaxVal(int)));
	connect(p,SIGNAL(setDlgVal(int)),this,SLOT(setVal(int)));
	connect(p,SIGNAL(setSeconds(int)),this,SLOT(setSecondsRemaining(int)));

    c->moveToThread(t1);
    p->moveToThread(t2);

    t1->start();
    t2->start();
}
예제 #4
0
void DlgPreferences::onHide() {
    // Notify children that we are about to hide.
    emit(closeDlg());

    // Notify other parts of Mixxx that the preferences window just saved and so
    // preferences are likely changed.
    m_preferencesUpdated.set(1);
}
예제 #5
0
/*------------------------------------------------------------------------------------------------------------------
  -- FUNCTION: openDlg
  --
  -- DATE: March 20, 2011
  --
  -- REVISIONS: (Date and Description)
  --
  -- DESIGNER: Duncan Donaldson.
  --
  -- PROGRAMMER: Duncan Donaldson.
  --
  -- INTERFACE: void MainWindow::openDlg(void)
  --
  -- RETURNS: void.
  --
  -- NOTES:
  -- opens a dialog to get the server address and connects various slots and signals.
  ----------------------------------------------------------------------------------------------------------------------*/
void MainWindow::openDlg() {
    dialog_ = new Dialog();
    dialog_->open();
    connect(this, SIGNAL(connectServer(QString&)), this, SLOT(connectToServer(QString&)));
    connect(dialog_->ui->buttonBox, SIGNAL(accepted()), this, SLOT(getServInfo()));
    connect(dialog_->ui->buttonBox, SIGNAL(rejected()), this, SLOT(closeDlg()));
    connect(this, SIGNAL(display(QString)), this, SLOT(addChatText(QString)));
}
예제 #6
0
int Progress::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: updateProgress(); break;
        case 1: cancelBtn(); break;
        case 2: closeEvent((*reinterpret_cast< QCloseEvent*(*)>(_a[1]))); break;
        case 3: closeDlg(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
void SyncMeasuresDialogCentralWidget::lowerPushButtonClicked()
{
  std::vector<BCLMeasure> newMeasures;

  // Must convert from the checked component to the appropriate measure for updating
  unsigned index = 0;
  for (Component* component : m_collapsibleComponentList->components()){
    if (component->checkBox()->isChecked() && component->checkBox()->isEnabled()){
      newMeasures.push_back(m_measures.at(m_pageIdx * NUM_COMPONENTS_DISPLAYED + index));
    }
    ++index;
  }

  if(!newMeasures.empty()){
    bool showMessage = true;
    m_measureManager->updateMeasures(*m_project,newMeasures,showMessage);
  }

  emit closeDlg();

}
예제 #8
0
void BrowsePicture::splitPic(QString filename,const SPLITArg &arg)
{
  MySplitThread *split = new MySplitThread;

  connect(split,SIGNAL(done()),this,SLOT(doneSuccess()));
  connect(split,SIGNAL(fail()),this,SLOT(doneFail()));
  connect(split,SIGNAL(showpic(QString)),this,SLOT(ShowDonePicture(QString)));
  connect(split,SIGNAL(showDoingPic(QString)),this,SLOT(ShowThumbnail(QString)));
  split->setPath(filename);
  split->setArg(arg);
  Progress *dlg = new Progress;
  dlg->setFlag(0);
   dlg->setPathName(filename);
   dlg->setArg(arg);
   dlg->setProgressMax();//设置进度条最大值
   dlg->setSplitThread(split);//为了在进度条取消或关闭时终止线程 并释放空间
   dlg->show();
   connect(split,SIGNAL(done()),dlg,SLOT(closeDlg()));
   split->start();
   splitthread_list.append(split);
   splitprogress_list.append(dlg);
}
예제 #9
0
void BrowsePicture::ShowImage()
{
 MyMergeThread *merge = new MyMergeThread;
 merge->setArg(arg);
 merge->setPath(pic_path);
 setMergeThread(merge);
  Progress *dlg = new Progress;
  dlg->setFlag(2);
  dlg->setPathName(pic_path);
  dlg->setMergeArg(merge->getMergeArg());
  dlg->setArg(arg);
  dlg->setProgressMax();
  dlg->setMergeThread(merge);//为了在进度条取消或关闭时终止线程 并释放空间
  dlg->show();
  connect(merge,SIGNAL(done()),this,SLOT(doneSuccess()));
  connect(merge,SIGNAL(fail()),this,SLOT(doneFail()));
  connect(merge,SIGNAL(showpic(QString)),this,SLOT(ShowDonePicture(QString)));
  connect(merge,SIGNAL(showDoingPic(QString)),this,SLOT(ShowThumbnail(QString)));
  connect(merge,SIGNAL(done()),dlg,SLOT(closeDlg()));
  merge->start();
  mergethread_list.append(merge);
  mergeprogress_list.append(dlg);
}
예제 #10
0
  --
  -- DESIGNER: Duncan Donaldson.
  --
  -- PROGRAMMER: Duncan Donaldson.
  --
  -- INTERFACE: void MainWindow::closeDlg(void)
  --
  -- RETURNS: void.
  --
  -- NOTES:
  -- closes a dialog to get the server address and disconnects various slots and signals.
  ----------------------------------------------------------------------------------------------------------------------*/
void MainWindow::closeDlg() {
    disconnect(this, SIGNAL(connectServer(QString&)), this, SLOT(connectToServer(QString&)));
    disconnect(dialog_->ui->buttonBox, SIGNAL(accepted()), this, SLOT(getServInfo()));
    disconnect(dialog_->ui->buttonBox, SIGNAL(rejected()), this, SLOT(closeDlg()));
    disconnect(this, SIGNAL(display(QString)), this, SLOT(addChatText(QString)));
    delete dialog_;
}
/*------------------------------------------------------------------------------------------------------------------
  -- FUNCTION: getServInfo
  --
  -- DATE: March 20, 2011
  --
  -- REVISIONS: (Date and Description)
  --
  -- DESIGNER: Duncan Donaldson.
  --
  -- PROGRAMMER: Duncan Donaldson.
  --
  -- INTERFACE: void MainWindow::getServInfo(void)