本文整理汇总了C++中SIGNAL类的典型用法代码示例。如果您正苦于以下问题:C++ SIGNAL类的具体用法?C++ SIGNAL怎么用?C++ SIGNAL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SIGNAL类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ofd
void MainWindow::fileOpen()
{
QFileDialog ofd(this, tr("Open ILDA file"), "");
ofd.setFileMode(QFileDialog::AnyFile);
ofd.setFilter(tr("ILDA files (*.ild);;All files (*.*)"));
ofd.setViewMode(QFileDialog::Detail);
if (ofd.exec())
{
QString fileName = ofd.selectedFiles().at(0);
QFileInfo fileInfo(fileName);
if (fileInfo.exists())
{
ReaderWriterILDA reader;
_sequence = QSharedPointer<Sequence>(reader.readFile(fileName));
_sequence->setPalette(*_currentPalette);
// Fill file statistics
fileNameLabel->setText(fileInfo.fileName());
fileSizeLabel->setText(getFileSize(fileInfo.size()));
ildaFormatLabel->setText(reader.version());
numberOfFramesLabel->setText(QString::number(_sequence->frameCount()));
// Set the current drawing mode (FIXME: Do not query the GUI for such infos)
if (normalRadioButton->isChecked())
_sequence->setDrawMode(Sequence::DrawModeNormal);
else if (diagnosticRadioButton->isChecked())
_sequence->setDrawMode(Sequence::DrawModeDiagnostic);
// Setup frame slider
frameSlider->setRange(0, _sequence->frameCount()-1);
// Build the connections
connect(_sequence.data(), SIGNAL(frameChanged(Frame*)), this, SLOT(frameChanged(Frame*)));
connect(firstFrameButton, SIGNAL(clicked()), _sequence.data(), SLOT(gotoFirstFrame()));
connect(lastFrameButton, SIGNAL(clicked()), _sequence.data(), SLOT(gotoLastFrame()));
connect(stopButton, SIGNAL(clicked()), _sequence.data(), SLOT(stopPlayback()));
connect(playButton, SIGNAL(clicked()), _sequence.data(), SLOT(startPlayback()));
connect(frameSlider, SIGNAL(valueChanged(int)), _sequence.data(), SLOT(setActiveFrame(int)));
connect(normalRadioButton, SIGNAL(clicked()), this, SLOT(drawModeChanged()));
connect(diagnosticRadioButton, SIGNAL(clicked()), this, SLOT(drawModeChanged()));
QGraphicsScene *scene = new QGraphicsScene();
scene->addItem(_sequence.data());
graphicsView->setScene(scene);
// FIXME: Need to call this until a resize event happens.
resizeEvent(NULL);
}
开发者ID:BGCX261,项目名称:zilda-svn-to-git,代码行数:51,代码来源:MainWindow.cpp
示例2: connect
/// Adds machine @a m to the project
void Project::addMachine(Machine* m)
{
if (!m)
return;
machine = m;
machine->setProject(this);
connect(machine, SIGNAL(newCanvasSize(int,int)), main->getScrollView()->getDrawArea(), SLOT(resizeContentsNotSmaller(int,int)) );
connect(main->getScrollView()->getDrawArea(), SIGNAL(updateCanvasSize(int,int, double)), machine, SLOT(updateCanvasSize(int, int, double)) ); // re-added 19/01/2015
connect(machine, SIGNAL(repaint()), main, SLOT(repaintViewport()));
main->updateIOView(machine);
}
开发者ID:Kampbell,项目名称:qfsm,代码行数:15,代码来源:Project.cpp
示例3: setFleetHealth
void HumanPlayer::installFleet()
{
setFleetHealth(myField->getFleet());
connect(plrFieldView.data(), SIGNAL(placeShip(int,int)), myField.data(), SLOT(setShip(int,int)));
connect(plrFieldView.data(), SIGNAL(deleteShip(int)), myField.data(), SLOT(deleteShip(int)));
connect(infoTab.data(), SIGNAL(readyToFight()), myField.data(), SLOT(checkIsFleetReady()));
connect(myField.data(), SIGNAL(fleetInstalled()), this, SLOT(reEmitFleetInstalled()));
/*
connect(fleetInstaller, SIGNAL(shipPlacedSuccesfully(NameOfShips, int))
, view, SLOT(changeCounter(NameOfShips,int)));
*/
}
开发者ID:SunInJuly,项目名称:SeaBattle,代码行数:14,代码来源:humanPlayer.cpp
示例4: connect
void MainWindow2::makeColorPaletteConnections()
{
connect(m_pColorPalette, SIGNAL(colorChanged(QColor)),
editor->colorManager(), SLOT(pickColor(QColor)));
connect(m_pColorPalette, SIGNAL(colorNumberChanged(int)),
editor->colorManager(), SLOT(pickColorNumber(int)));
connect(editor->colorManager(), SIGNAL(colorChanged(QColor)),
m_pColorPalette, SLOT(setColor(QColor)));
connect(editor->colorManager(), SIGNAL(colorNumberChanged(int)),
m_pColorPalette, SLOT(selectColorNumber(int)));
}
开发者ID:Verlet,项目名称:pencil,代码行数:14,代码来源:mainwindow2.cpp
示例5: S60VideoDisplay
S60VideoWidgetDisplay::S60VideoWidgetDisplay(QObject *parent)
: S60VideoDisplay(parent)
, m_widget(new S60VideoWidget)
{
connect(this, SIGNAL(paintingEnabledChanged(bool)), m_widget, SLOT(setPaintingEnabled(bool)));
connect(this, SIGNAL(fullScreenChanged(bool)), m_widget, SLOT(setFullScreen(bool)));
connect(this, SIGNAL(contentRectChanged(const QRect&)), m_widget, SLOT(setContentRect(const QRect &)));
#ifndef VIDEOOUTPUT_GRAPHICS_SURFACES
connect(m_widget, SIGNAL(beginVideoWidgetNativePaint()), this, SIGNAL(beginVideoWindowNativePaint()));
connect(m_widget, SIGNAL(endVideoWidgetNativePaint()), this, SIGNAL(endVideoWindowNativePaint()));
#endif
m_widget->installEventFilter(this);
m_widget->setPaintingEnabled(false);
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:14,代码来源:s60videowidgetdisplay.cpp
示例6: CellmlAnnotationViewWidget
QWidget * CellMLAnnotationViewPlugin::viewWidget(const QString &pFileName)
{
// Check that we are dealing with a CellML file
if (!CellMLSupport::CellmlFileManager::instance()->cellmlFile(pFileName))
// We are not dealing with a CellML file, so...
return 0;
// Retrieve the view widget associated with the file name
CellmlAnnotationViewWidget *res = mViewWidgets.value(pFileName);
// Create a new view widget, if none could be retrieved
if (!res) {
res = new CellmlAnnotationViewWidget(this, pFileName, mMainWindow);
// Initialise our new view widget's sizes
res->setSizes(mSizes);
res->metadataDetails()->splitter()->setSizes(mMetadataDetailsWidgetSizes);
// Keep track of the splitter move in our new view widget
connect(res, SIGNAL(splitterMoved(const QList<int> &)),
this, SLOT(splitterMoved(const QList<int> &)));
connect(res->metadataDetails(), SIGNAL(splitterMoved(const QList<int> &)),
this, SLOT(metadataDetailsWidgetSplitterMoved(const QList<int> &)));
// Some other connections to handle splitter moves between our view
// widgets
foreach (CellmlAnnotationViewWidget *viewWidget, mViewWidgets) {
// Make sur that our new view widget is aware of any splitter move
// occuring in the other view widget
connect(res, SIGNAL(splitterMoved(const QList<int> &)),
viewWidget, SLOT(updateSizes(const QList<int> &)));
connect(res->metadataDetails(), SIGNAL(splitterMoved(const QList<int> &)),
viewWidget->metadataDetails(), SLOT(updateSizes(const QList<int> &)));
// Make sur that the other view widget is aware of any splitter move
// occuring in our new view widget
connect(viewWidget, SIGNAL(splitterMoved(const QList<int> &)),
res, SLOT(updateSizes(const QList<int> &)));
connect(viewWidget->metadataDetails(), SIGNAL(splitterMoved(const QList<int> &)),
res->metadataDetails(), SLOT(updateSizes(const QList<int> &)));
}
开发者ID:nickerso,项目名称:original-opencor,代码行数:50,代码来源:cellmlannotationviewplugin.cpp
示例7: QToolBar
PenBrushToolBar::PenBrushToolBar(DiagramView* diagram) : QToolBar("Pen and Brush")
{
mDiagram = diagram;
connect(mDiagram, SIGNAL(propertiesChanged()), this, SLOT(updateDiagramUnits()));
connect(this, SIGNAL(propertyChanged(const QString&,const QVariant&)),
mDiagram, SLOT(updateItemProperty(const QString&,const QVariant&)));
connect(this, SIGNAL(propertiesChanged(const QHash<QString,QVariant>&)),
mDiagram, SLOT(updateDefaultItemProperties(const QHash<QString,QVariant>&)));
mPenWidthEdit = new UnitsValueEdit(mDiagram->scene()->units(), UnitsValueEdit::NonNegativesOnly, false);
mPenWidthEdit->setValue(mPenWidthEdit->units() == UnitsMils ? 16 : 0.4);
mPenWidthEdit->setToolTip("Pen width");
connect(mPenWidthEdit, SIGNAL(editingFinished()), this, SLOT(updatePenWidth()));
mPenStyleButton = new PenStyleToolButton();
mPenStyleButton->setToolTip("Pen Style");
connect(mPenStyleButton, SIGNAL(styleChanged(Qt::PenStyle)), this, SLOT(updatePenStyle(Qt::PenStyle)));
mStartArrowButton = new ArrowStyleToolButton(false);
mStartArrowButton->setToolTip("Start Arrow Style");
mStartArrowButton->setStyle(DrawingArrow::None);
connect(mStartArrowButton, SIGNAL(styleChanged(DrawingArrow::Style)), this, SLOT(updateStartArrowStyle(DrawingArrow::Style)));
mEndArrowButton = new ArrowStyleToolButton(true);
mEndArrowButton->setToolTip("End Arrow Style");
mEndArrowButton->setStyle(DrawingArrow::None);
connect(mEndArrowButton, SIGNAL(styleChanged(DrawingArrow::Style)), this, SLOT(updateEndArrowStyle(DrawingArrow::Style)));
mPenColorButton = new ColorToolButton(QIcon(":/icons/oxygen/pen.png"), "Pen Color");
mPenColorButton->setColor(QColor(0, 0, 0));
mPenColorButton->setToolTip("Pen Color");
connect(mPenColorButton, SIGNAL(colorChanged(const QColor&)), this, SLOT(updatePenColor(const QColor&)));
mBrushColorButton = new ColorToolButton(QIcon(":/icons/oxygen/fill-color.png"), "Brush Color");
mBrushColorButton->setColor(QColor(255, 255, 255));
mBrushColorButton->setToolTip("Brush Color");
connect(mBrushColorButton, SIGNAL(colorChanged(const QColor&)), this, SLOT(updateBrushColor(const QColor&)));
setObjectName("PenBrushToolBar");
addWidget(mPenStyleButton);
addWidget(mPenWidthEdit);
addSeparator();
addWidget(mStartArrowButton);
addWidget(mEndArrowButton);
addSeparator();
addWidget(mPenColorButton);
addWidget(mBrushColorButton);
emit propertiesChanged(properties());
}
开发者ID:jaallen85,项目名称:jade-legacy,代码行数:50,代码来源:DiagramToolBar.cpp
示例8: QWidget
RegAccess::RegAccess(QWidget *parent, Qt::WFlags flags)
: QWidget(parent, flags)
, m_currentStep(-1)
, m_bEnable_SlotRegAccessItemStateChanged(true)
, m_gpio(0xAA)
{
setupUi(this);
//QWidget* widget = new QWidget(scrollArea);
QVBoxLayout* layout = new QVBoxLayout(groupBoxRegAcessItems);
QSignalMapper* signalMapper = new QSignalMapper(this);
for (int i = 0; i < 16; ++i)
{
RegAccessItem* widget = new RegAccessItem(groupBoxRegAcessItems);
widget->labelNo->setText(QString("%1").arg(i));
widget->setMinimumSize(QSize(0, 20));
widget->setMaximumSize(QSize(16777215, 16777215));
layout->addWidget(widget);
connect(widget->checkBox, SIGNAL(stateChanged(int)), signalMapper, SLOT(map()));
signalMapper->setMapping(widget->checkBox, widget);
m_regAccessItems.push_back(widget);
}
connect(signalMapper, SIGNAL(mapped(QWidget*)),
this, SLOT(slotRegAccessItemStateChanged(QWidget*)));
bool ok = connect(buttonGroup0, SIGNAL(buttonClicked(int)), this, SLOT(SetGpio(int)));
Q_ASSERT(ok);
ok = connect(buttonGroup1, SIGNAL(buttonClicked(int)), this, SLOT(SetGpio(int)));
Q_ASSERT(ok);
ok = connect(buttonGroup2, SIGNAL(buttonClicked(int)), this, SLOT(SetGpio(int)));
Q_ASSERT(ok);
ok = connect(buttonGroup3, SIGNAL(buttonClicked(int)), this, SLOT(SetGpio(int)));
Q_ASSERT(ok);
//connect(buttonGroup1, SIGNAL(clicked(int)), SLOT(SetGpio()));
//connect(buttonGroup2, SIGNAL(clicked(int)), SLOT(SetGpio()));
//connect(buttonGroup3, SIGNAL(clicked(int)), SLOT(SetGpio()));
QSpacerItem* verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
layout->addItem(verticalSpacer);
m_settings.beginGroup("RegAccess");
readSettings(m_settings);
}
开发者ID:Quenii,项目名称:adcevm,代码行数:49,代码来源:RegAccess.cpp
示例9: serverId
Thread::Thread(uint _serverId, uint _threadId, uint to, uint rc, bool _validated, bool _validate, QWidget * p, NntpHost *nh) :
serverId(_serverId), threadId(_threadId), threadTimeout(rc * 60 * 1000) /* minutes */, validated(_validated)
{
retryCount = 0;
timeout = to * 1000;
//qDebug() << "Idle to = " << threadTimeout;
threadBytes = new uint;
*threadBytes = 0;
prevBytes = 0;
resetSpeed();
QueueScheduler* queueScheduler = ((QMgr*)p)->getQueueScheduler();
nntpT = new NntpThread(serverId, threadId, threadBytes, queueScheduler->getIsRatePeriod(), queueScheduler->getIsNilPeriod(), validated, _validate, nh, (QMgr*)p);
connect(nntpT, SIGNAL(StartedWorking(int, int)), p, SLOT(started(int, int)));
connect(nntpT, SIGNAL(Start(Job *)), p, SLOT(start(Job *)));
connect(nntpT, SIGNAL(DownloadFinished(Job *)), p, SLOT(finished(Job *)));
connect(nntpT, SIGNAL(DownloadCancelled(Job *)), p, SLOT(downloadCancelled(Job *)));
connect(nntpT, SIGNAL(DownloadError(Job *, int)), p, SLOT(downloadError(Job *, int)));
connect(nntpT, SIGNAL(Finished(Job *)), p, SLOT(finished(Job *)));
connect(nntpT, SIGNAL(Cancelled(Job *)), p, SLOT(cancel(Job *)));
connect(nntpT, SIGNAL(Err(Job *, int)), p, SLOT(Err(Job *, int)));
connect(nntpT, SIGNAL(Failed(Job *, int)), p, SLOT(Failed(Job *, int)));
connect(nntpT, SIGNAL(SigPaused(int, int, bool)), p, SLOT(paused(int, int, bool)));
connect(nntpT, SIGNAL(SigDelayed_Delete(int, int)), p, SLOT(delayedDelete(int, int)));
connect(nntpT, SIGNAL(SigReady(int, int)), p, SLOT(stopped(int, int)));
connect(nntpT, SIGNAL(SigClosingConnection(int, int)), p, SLOT(connClosed(int, int)));
connect(nntpT, SIGNAL(SigUpdate(Job *, uint, uint, uint)), p, SLOT(update(Job *, uint, uint, uint)));
connect(nntpT, SIGNAL(SigUpdatePost(Job *, uint, uint, uint, uint)), p, SLOT(updatePost(Job *, uint, uint, uint, uint)));
connect(nntpT, SIGNAL(SigUpdateLimits(Job *, uint, uint, uint)), p, SLOT(updateLimits(Job *, uint, uint, uint)));
connect(nntpT, SIGNAL(sigHeaderDownloadProgress(Job*, quint64, quint64, quint64)), p, SLOT(slotHeaderDownloadProgress(Job*, quint64, quint64, quint64)));
connect(nntpT, SIGNAL(SigExtensions(Job *, quint16, quint64)), p, SLOT(updateExtensions(Job *, quint16, quint64)));
connect(nntpT, SIGNAL(logMessage(int, QString)), quban->getLogAlertList(), SLOT(logMessage(int, QString)));
connect(nntpT, SIGNAL(logEvent(QString)), quban->getLogEventList(), SLOT(logEvent(QString)));
connect(nntpT, SIGNAL(serverValidated(uint, bool, QString, QList<QSslError>)), p, SLOT(serverValidated(uint, bool, QString, QList<QSslError>)));
connect(nntpT, SIGNAL(registerSocket(RcSslSocket*)), p, SIGNAL(registerSocket(RcSslSocket*))); // Pass it on to RateController
connect(nntpT, SIGNAL(unregisterSocket(RcSslSocket*)), p, SIGNAL(unregisterSocket(RcSslSocket*))); // Pass it on to RateController
speedTimer = new QTimer();
speedTimer->setSingleShot(false);
idleTimer = new QTimer();
retryTimer = new QTimer();
connect(speedTimer, SIGNAL(timeout()), SLOT(slotSpeedTimeout()));
connect(idleTimer, SIGNAL(timeout()), SLOT(slotIdleTimeout()));
connect(retryTimer, SIGNAL(timeout()), SLOT(slotRetryTimeout()));
}
开发者ID:quban2,项目名称:quban,代码行数:49,代码来源:queueparts.cpp
示例10: QLabel
MainWindow::MainWindow(QApplication* app)
{
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
this->setWindowTitle("kmeans");
// create status bar
m_framesPerSec = new QLabel("nA");
m_framesPerSec->setMinimumSize(m_framesPerSec->sizeHint());
m_framesPerSec->setAlignment(Qt::AlignLeft);
m_framesPerSec->setToolTip("Current frames per second not yet initialized.");
statusBar()->addWidget(m_framesPerSec);
m_viewport = new Viewport(this);
m_viewport->show();
m_toolBox = new ToolBox();
QSplitter* splitter = new QSplitter(Qt::Horizontal);
splitter->insertWidget(0, m_toolBox);
splitter->insertWidget(1, m_viewport);
QList<int> sizes;
sizes.append(200);
sizes.append(1300);
splitter->setSizes(sizes);
splitter->setStretchFactor(0, 1);
splitter->setStretchFactor(1, 1);
splitter->setChildrenCollapsible(false);
setCentralWidget(splitter);
connect(m_viewport, SIGNAL(framesPerSecondChanged(int)), this, SLOT(updateFramesPerSecond(int)));
connect(m_toolBox, SIGNAL(setSeedingAlgorithm(SeedingAlgorithm)), m_viewport, SLOT(setSeedingAlgorithm(SeedingAlgorithm)));
connect(m_toolBox->m_doClusterButton, SIGNAL(clicked()), m_viewport, SLOT(doCluster()));
connect(m_toolBox->m_findKButton, SIGNAL(clicked()), m_viewport, SLOT(findK()));
connect(m_toolBox->m_kBox, SIGNAL(valueChanged(int)), m_viewport, SLOT(setK(int)));
connect(m_toolBox->m_iterationsBox, SIGNAL(valueChanged(int)), m_viewport, SLOT(setIterations(int)));
connect(m_toolBox->m_runBox, SIGNAL(valueChanged(int)), m_viewport, SLOT(setRuns(int)));
connect(m_toolBox->m_clearButton, SIGNAL(clicked()), m_viewport, SLOT(doClear()));
connect(m_toolBox->m_clearSeedButton, SIGNAL(clicked()), m_viewport, SLOT(doClearSeed()));
show();
this->adjustSize();
m_viewport->updateGL();
m_viewport->m_timer->start();
}
开发者ID:markusd,项目名称:gpgpu,代码行数:49,代码来源:mainwindow.cpp
示例11: QMainWindow
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
video=new VideoWidget;
wid=new Widget;
/*docwidget=new QDockWidget("Controlers",this);
docwidget->setWidget(wid);
docwidget->setFloating(false);
addDockWidget(Qt::BottomDockWidgetArea,docwidget);*/
list=new QListWidget;
media=new QMediaPlayer;
video=new VideoWidget;
connect(wid->play,SIGNAL(clicked(bool)),this,SLOT(playmedia()));
connect(wid->stop,SIGNAL(clicked(bool)),this,SLOT(stopmedia()));
connect(wid->volume,SIGNAL(clicked(bool)),this,SLOT(mute()));
connect(wid->vol,SIGNAL(valueChanged(int)),media,SLOT(setVolume(int)));
connect(wid->vol,SIGNAL(valueChanged(int)),wid->l,SLOT(setNum(int)));
connect(wid->vol,SIGNAL(valueChanged(int)),media,SLOT(setVolume(int)));
connect(media,&QMediaPlayer::durationChanged,wid->slider,&QSlider::setMaximum);
connect(wid->slider,&QSlider::sliderMoved,media,&QMediaPlayer::setPosition);
connect(wid->slider,&QSlider::valueChanged,this,&MainWindow::endofmedia);
connect(media,&QMediaPlayer::positionChanged,wid->slider,&QSlider::setValue);
connect(media,&QMediaPlayer::positionChanged,this,&MainWindow::updateduration);
connect(wid->netx,&QToolButton::clicked,this,&MainWindow::netxtrack);
connect(wid->prev,&QToolButton::clicked,this,&MainWindow::prevtrack);
connect(wid->replay,&QToolButton::clicked,this,&MainWindow::replay);
connect(list,SIGNAL(activated(QModelIndex)),this,SLOT(curentmediachange(QModelIndex)));
//connect(media,SIGNAL(mediaChanged(QMediaContent)),this,SLOT(SetWindowTitle(QMediaContent)));
p=new QMediaPlaylist;
connect(wid->playlist,&QToolButton::clicked,this,&MainWindow::addtoplaylist);
media->setVideoOutput(video);
QScrollBar *scrol1=new QScrollBar;
list->addScrollBarWidget(scrol1,Qt::AlignBottom);
QScrollBar *scrol2=new QScrollBar;
list->addScrollBarWidget(scrol2,Qt::AlignBottom);
QWidget *W=new QWidget;
QBoxLayout *hb=new QHBoxLayout;
hb->addWidget(video, 2);
hb->addWidget(list);
QBoxLayout *vb=new QVBoxLayout;
vb->addLayout(hb);
vb->addWidget(wid);
W->setLayout(vb);
setCentralWidget(W);
QSize Size;
Size.setWidth(200);
Size.setHeight(100);
setMinimumSize(video->size()+Size);
setWindowIcon(QIcon(tr(":/Multimedia 1.ico")));
}
开发者ID:qpt,项目名称:Video-Player,代码行数:49,代码来源:mainwindow.cpp
示例12: WebDialogProviderValidatedSpinBox
int WebDialogProvider::getInteger(QWidget *parent,
const QString &title, const QString &label, int value,
int minValue, int maxValue, int step, bool *ok, Qt::WindowFlags flags)
{
WebDialogProviderValidatedSpinBox *sb =
new WebDialogProviderValidatedSpinBox(minValue, maxValue, step, value);
WebDialogProvider dlg(title, label, parent, sb, flags);
connect(sb, SIGNAL(textChanged(bool)), dlg.okButton, SLOT(setEnabled(bool)));
bool accepted = (dlg.exec() == QDialog::Accepted);
if (ok)
{
*ok = accepted;
}
return sb->value();
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:15,代码来源:WebDialogProvider.cpp
示例13: newRequestNoParams
void newRequestNoParams() {
QVERIFY(this->so->write(binaryBeginRequest(1, 1, 0)) > 0);
QVERIFY(this->so->write(binaryParam(1, QByteArray())) > 0);
QSignalSpy spy(this->fcgi, SIGNAL(newRequest(QFCgiRequest*)));
QObject::connect(this->fcgi, SIGNAL(newRequest(QFCgiRequest*)), loop, SLOT(quit()));
loop->exec();
QFCgiRequest *request = qvariant_cast<QFCgiRequest*>(spy.at(0).at(0));
QVERIFY(request != 0);
QCOMPARE(request->getParams().count(), 0);
request->endRequest(0);
}
开发者ID:albert-mirzoyan,项目名称:qfcgi,代码行数:15,代码来源:request.cpp
示例14: _ui
MainWidget::MainWidget( QWidget * parent )
:QWidget(parent), _ui(new Ui::MainWidget)
{
this->_ui->setupUi(this);
connect(_ui->buttonCamera, SIGNAL(clicked()), this, SLOT(startCamera()));
connect(_ui->buttonLoadFile, SIGNAL(clicked()), this, SLOT(loadFile()));
connect(_ui->checkBoxEdgeDetect, SIGNAL(toggled(bool)), this, SLOT(enableEdgeDetector(bool)));
this->_capture = new ImageCapture(this);
connect(_capture, SIGNAL(error(const QString&)), this, SLOT(captureError(const QString&)));
connect(_capture, SIGNAL(imageCaptured(const QImage&)), this, SLOT(displayImage(const QImage&)));
connect(_ui->sliderThreshold, SIGNAL(valueChanged(int)), _capture, SLOT(setEdgeDetectorThreshold(int)));
connect(_ui->checkBoxFlip, SIGNAL(toggled(bool)), _capture, SLOT(flipImage(bool)));
_ui->sliderThreshold->setEnabled( _ui->checkBoxEdgeDetect->isChecked() );
_capture->flipImage( _ui->checkBoxFlip->isChecked() );
}
开发者ID:ajapco,项目名称:MinotaurMBEDLabyrinthSolver,代码行数:15,代码来源:MainWidget.cpp
示例15: ReviewWidget
void MainWindow::previewChanges()
{
m_reviewWidget = new ReviewWidget(m_stack);
connect(this, SIGNAL(backendReady(QApt::Backend*)),
m_reviewWidget, SLOT(setBackend(QApt::Backend*)));
m_reviewWidget->setBackend(m_backend);
m_stack->addWidget(m_reviewWidget);
m_stack->setCurrentWidget(m_reviewWidget);
m_previewAction->setIcon(QIcon::fromTheme("go-previous"));
m_previewAction->setText(i18nc("@action:intoolbar Return from the preview page", "Back"));
disconnect(m_previewAction, SIGNAL(triggered()), this, SLOT(previewChanges()));
connect(m_previewAction, SIGNAL(triggered()), this, SLOT(returnFromPreview()));
}
开发者ID:KDE,项目名称:muon,代码行数:15,代码来源:MainWindow.cpp
示例16: QGraphicsView
Context::ToolbarView::ToolbarView( Plasma::Containment* containment, QGraphicsScene* scene, QWidget* parent )
: QGraphicsView( scene, parent )
, m_height( 36 )
, m_cont( containment )
{
setObjectName( "ContextToolbarView" );
setFixedHeight( m_height );
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
setAutoFillBackground( true );
setContentsMargins( 0, 0, 0, 0 );
setFrameStyle( QFrame::NoFrame );
applyStyleSheet();
connect( The::paletteHandler(), SIGNAL(newPalette(QPalette)), SLOT(applyStyleSheet()) );
//Padding required to prevent view scrolling, probably caused by the 1px ridge
setSceneRect( TOOLBAR_X_OFFSET, 0, size().width()-TOOLBAR_SCENE_PADDING,
size().height()-TOOLBAR_SCENE_PADDING );
setInteractive( true );
setAcceptDrops( true );
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
// now we create the toolbar
m_toolbar = new AppletToolbar(0);
scene->addItem(m_toolbar.data());
m_toolbar.data()->setContainment( qobject_cast<Context::Containment *>(containment) );
m_toolbar.data()->setZValue( m_toolbar.data()->zValue() + 1000 );
m_toolbar.data()->setPos( TOOLBAR_X_OFFSET, 0 );
connect( m_toolbar.data(), SIGNAL(configModeToggled()), SLOT(toggleConfigMode()) );
connect( m_toolbar.data(), SIGNAL(hideAppletExplorer()), SIGNAL(hideAppletExplorer()) );
connect( m_toolbar.data(), SIGNAL(showAppletExplorer()), SIGNAL(showAppletExplorer()) );
Context::Containment* cont = dynamic_cast< Context::Containment* >( containment );
if( cont )
{
connect( cont, SIGNAL(appletAdded(Plasma::Applet*,int)), m_toolbar.data(), SLOT(appletAdded(Plasma::Applet*,int)) );
connect( m_toolbar.data(), SIGNAL(appletAddedToToolbar(Plasma::Applet*,int)), this, SLOT(appletAdded(Plasma::Applet*,int)) );
connect( cont, SIGNAL(appletRemoved(Plasma::Applet*)), this, SLOT(appletRemoved(Plasma::Applet*)) );
connect( m_toolbar.data(), SIGNAL(showApplet(Plasma::Applet*)), cont, SLOT(showApplet(Plasma::Applet*)) );
connect( m_toolbar.data(), SIGNAL(moveApplet(Plasma::Applet*,int,int)), cont, SLOT(moveApplet(Plasma::Applet*,int,int)) );
}
}
开发者ID:cancamilo,项目名称:amarok,代码行数:48,代码来源:ToolbarView.cpp
示例17: disconnect
void VPlotOps::newSelection(VPlot * selPlot, bool forceConnect) {
if (selPlot != m_selPlot || forceConnect) {
if (!m_firstTime) {
m_selPlot->setFrameStyle(0);
disconnect(b_logx, SIGNAL(stateChanged(int)), m_selPlot->m_vcp, SLOT(doLogX(int)));
disconnect(b_logy, SIGNAL(stateChanged(int)), m_selPlot->m_vcp, SLOT(doLogY(int)));
disconnect(b_logz, SIGNAL(stateChanged(int)), m_selPlot->m_vcp, SLOT(doLogZ(int)));
if (m_selPlot->m_multipleModules) {
disconnect(b_moduleSelector1, SIGNAL(currentIndexChanged(int)), m_selPlot, SLOT(moduleChanged()));
disconnect(b_moduleSelector2, SIGNAL(currentIndexChanged(int)), m_selPlot, SLOT(moduleChanged()));
m_moduleSelector->setEnabled(false);
}
disconnect(b_popout, SIGNAL(clicked()), m_selPlot->m_vcp, SLOT(popoutClicked()));
disconnect(b_ref, SIGNAL(clicked()), m_selPlot->m_vcp, SLOT(refreshClicked()));
delete m_statsBox;
}
m_firstTime = false;
if (selPlot->m_vcp->m_xLogged) b_logx->setChecked(true);
else b_logx->setChecked(false);
if (selPlot->m_vcp->m_yLogged) b_logy->setChecked(true);
else b_logy->setChecked(false);
if (selPlot->m_vcp->m_zLogged) b_logz->setChecked(true);
else b_logz->setChecked(false);
m_selPlot = selPlot;
m_selPlot->setFrameStyle(3);
connect(b_logx, SIGNAL(stateChanged(int)), selPlot->m_vcp, SLOT(doLogX(int)));
connect(b_logy, SIGNAL(stateChanged(int)), selPlot->m_vcp, SLOT(doLogY(int)));
connect(b_logz, SIGNAL(stateChanged(int)), selPlot->m_vcp, SLOT(doLogZ(int)));
connect(b_popout, SIGNAL(clicked()), selPlot->m_vcp, SLOT(popoutClicked()));
connect(b_ref, SIGNAL(clicked()), selPlot->m_vcp, SLOT(refreshClicked()));
if (m_selPlot->m_multipleModules) {
m_moduleSelector->setEnabled(true);
connect(b_moduleSelector1, SIGNAL(currentIndexChanged(int)), m_selPlot, SLOT(moduleChanged()));
connect(b_moduleSelector2, SIGNAL(currentIndexChanged(int)), m_selPlot, SLOT(moduleChanged()));
}
std::cout<<"Selection made"<<std::endl;
m_statsBox = selPlot->exportStatsBox();
m_layout->addWidget(m_statsBox, m_layout->rowCount(), 0, 1, m_layout->columnCount());
}
开发者ID:suvayu,项目名称:LHCbVeloView,代码行数:48,代码来源:VPlotOps.cpp
示例18: tr
//-----------------------------------------------------------------------------
//! Activate the Select From subscribed or favorites channels menu item
//-----------------------------------------------------------------------------
void tSiriusController::SelectFromChannels(const QList<tChannelRecord *>& chanList, const QString& title, bool needFavoritesColumn)
{
// First get the subscribed list
if ( chanList.isEmpty() )
{
// Assert(chanList.size() > 0); // Must be at least the currently playing channel
tMessageBox::Error( 0, tr("Subscribed"), tr("No channels"), tMessageBox::CLOSE );
return;
}
// If there is only 1 subscribed channel, it must be the the current channel
// TODO the dialog should say "Call Sirius"
m_pChannelsDialog = new tListenDialog(title, 0, needFavoritesColumn);
m_pChannelsDialog->SetAlignment(tDialog::AlignScreenCenter);
m_pChannelsTable = new tChannelSelect(0, needFavoritesColumn);
m_pChannelsTable->SetRecords(chanList, m_ChannelId);
// Close the dialog on channel selected
Connect(m_pChannelsTable, SIGNAL(activated(const QModelIndex&)),
this, SLOT(TuneToHighlightedChannelFromChannelsTable(const QModelIndex&)));
Connect(m_pChannelsDialog, SIGNAL(accepted()), this, SLOT(TuneToHighlightedChannelAndAcceptFromChannelsTable()));
Connect(this, SIGNAL(FavoriteUpdated(const bool)), m_pChannelsDialog, SLOT(OnFavoriteUpdated(const bool)));
Connect(m_pChannelsTable, SIGNAL(NewFocusRow(const int)), this, SLOT(OnNewFocusRow(const int)));
Connect(m_pChannelsDialog, SIGNAL(ToggleFavoriteMenuSelected()), m_pChannelsTable, SLOT(ToggleFavorite()));
// Close the dialog on cancel
Connect(m_pChannelsTable, SIGNAL(Cancel()), m_pChannelsDialog, SLOT(reject()));
Connect(m_pChannelsDialog, SIGNAL(WheelIndicatesScrollUp()), m_pChannelsTable, SLOT(OnWheelIndicatesScrollUp()));
Connect(m_pChannelsDialog, SIGNAL(WheelIndicatesScrollDown()), m_pChannelsTable, SLOT(OnWheelIndicatesScrollDown()));
// Layout
QVBoxLayout* pLayout = new QVBoxLayout;
pLayout->addWidget(m_pChannelsTable);
m_pChannelsDialog->setLayout(pLayout);
Connect(m_pChannelsTable, SIGNAL(RowLocationPossiblyChanged(const QRect)), m_pChannelsDialog, SLOT(OnRowLocationPossiblyChanged(const QRect)));
m_pChannelsDialog->exec();
delete m_pChannelsDialog;
m_pChannelsDialog = 0;
//delete m_pChannelsTable; we do not need to do this, it is owned by the dialog
m_pChannelsTable = 0;
}
开发者ID:dulton,项目名称:53_hero,代码行数:51,代码来源:tSiriusController.cpp
示例19: kdebugf
void TabsManager::insertTab(ChatWidget *chatWidget)
{
kdebugf();
Title->addChatWidget(chatWidget);
bool restoreChatGeometry = true;
// jeśli jest otwarty chatwindow przypisany do chat to zostanie on zamknięty
if (chatWidget->parentWidget())
{
chatWidget->parentWidget()->deleteLater();
restoreChatGeometry = false;
}
ContactSet contacts = chatWidget->chat().contacts();
DetachedChats.removeAll(chatWidget->chat());
for (Action *action : m_attachTabAction->actions())
{
if (action->context()->contacts() == contacts)
action->setChecked(true);
}
// Ustawiam tytul karty w zaleznosci od tego czy mamy do czynienia z rozmowa czy z konferencja
TabDialog->insertTab(TargetTabs, chatWidget, chatWidget->title()->blinkingIcon(), QString());
if (restoreChatGeometry)
chatWidget->kaduRestoreGeometry();
updateTabTitle(chatWidget);
TargetTabs = -1;
connect(chatWidget->edit(), SIGNAL(keyPressed(QKeyEvent*, CustomInput*, bool&)),
TabDialog, SLOT(chatKeyPressed(QKeyEvent*, CustomInput*, bool&)));
connect(chatWidget->title(), SIGNAL(titleChanged(ChatWidget*)), this, SLOT(onTitleChanged(ChatWidget*)));
CloseOtherTabsMenuAction->setEnabled(TabDialog->count() > 1);
// unreadMessagesCountChanged(chatWidget);
if (_isActiveWindow(TabDialog) && TabDialog->currentWidget() == chatWidget)
emit chatWidgetActivated(chatWidget);
kdebugf2();
}
开发者ID:vogel,项目名称:kadu,代码行数:48,代码来源:tabs.cpp
示例20: DirBrowserModel
void
FileBrowser::initView()
{
d->kdirModel = new DirBrowserModel( this );
d->mimeFilterProxyModel =
new MimeTypeFilterProxyModel( EngineController::supportedMimeTypes(), this );
d->mimeFilterProxyModel->setSourceModel( d->kdirModel );
d->mimeFilterProxyModel->setSortCaseSensitivity( Qt::CaseInsensitive );
d->mimeFilterProxyModel->setFilterCaseSensitivity( Qt::CaseInsensitive );
d->mimeFilterProxyModel->setDynamicSortFilter( true );
connect( d->searchWidget, SIGNAL( filterChanged( const QString & ) ),
d->mimeFilterProxyModel, SLOT( setFilterFixedString( const QString & ) ) );
d->fileView->setModel( d->mimeFilterProxyModel );
d->fileView->header()->setContextMenuPolicy( Qt::ActionsContextMenu );
d->fileView->header()->setVisible( true );
d->fileView->setDragEnabled( true );
d->fileView->setSortingEnabled( true );
d->fileView->setSelectionMode( QAbstractItemView::ExtendedSelection );
d->readConfig();
d->restoreHeaderState();
d->kdirModel->dirLister()->openUrl( d->currentPath );
for( int i = 0, columns = d->fileView->model()->columnCount(); i < columns ; ++i )
{
QAction *action =
new QAction( d->fileView->model()->headerData( i, Qt::Horizontal ).toString(),
d->fileView->header()
);
d->fileView->header()->addAction( action );
d->columnActions.append( action );
action->setCheckable( true );
if( !d->fileView->isColumnHidden( i ) )
action->setChecked( true );
connect( action, SIGNAL( toggled(bool) ), this, SLOT(toggleColumn(bool) ) );
}
connect( d->fileView->header(), SIGNAL(geometriesChanged()), this, SLOT(slotSaveHeaderState()) );
connect( d->fileView, SIGNAL(activated( const QModelIndex & )),
SLOT(itemActivated( const QModelIndex & )) );
if( !KGlobalSettings::singleClick() )
{
connect( d->fileView, SIGNAL(doubleClicked( const QModelIndex & )),
SLOT(itemActivated( const QModelIndex & ))
);
}
开发者ID:ErrAza,项目名称:amarok,代码行数:48,代码来源:FileBrowser.cpp
注:本文中的SIGNAL类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论