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);
		}
Exemple #2
0
/// 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);
}
Exemple #3
0
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)));
    */

}
Exemple #4
0
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)));
}
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);
}
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> &)));
        }
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());
}
Exemple #8
0
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);
}
Exemple #9
0
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()));
}
Exemple #10
0
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();
}
Exemple #11
0
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")));
}
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();
}
Exemple #13
0
  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);
  }
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() );
}
Exemple #15
0
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()));
}
Exemple #16
0
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)) );
   }

}
Exemple #17
0
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());
  }
Exemple #18
0
//-----------------------------------------------------------------------------
//! 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;
}
Exemple #19
0
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();
}
Exemple #20
0
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 & ))
               );
    }
BlackBerryCreatePackageStepConfigWidget::BlackBerryCreatePackageStepConfigWidget(BlackBerryCreatePackageStep *step)
    : ProjectExplorer::BuildStepConfigWidget()
    , m_step(step)
{
    m_ui = new Ui::BlackBerryCreatePackageStepConfigWidget;
    m_ui->setupUi(this);

    m_ui->cskPassword->setText(m_step->cskPassword());
    m_ui->keystorePassword->setText(m_step->keystorePassword());
    m_ui->savePasswords->setChecked(m_step->savePasswords());
    m_ui->qtLibraryPath->setText(m_step->qtLibraryPath());

    m_qtLibraryExplanations[0] = tr("Use the Qt libraries shipped with the BlackBerry device.");
    m_qtLibraryExplanations[1] = tr("Include Qt libraries in the package. "
                                    "This will increase the package size.");
    m_qtLibraryExplanations[2] = tr("Use deployed Qt libraries on the device.");
    m_ui->qtLibrary->addItem(tr("Use Pre-installed Qt"), BlackBerryCreatePackageStep::PreInstalledQt);
    m_ui->qtLibrary->addItem(tr("Bundle Qt in Package"), BlackBerryCreatePackageStep::BundleQt);
    m_ui->qtLibrary->addItem(tr("Use Deployed Qt"), BlackBerryCreatePackageStep::DeployedQt);

    connect(m_ui->signPackages, SIGNAL(toggled(bool)), this, SLOT(setPackageMode(bool)));
    connect(m_ui->cskPassword, SIGNAL(textChanged(QString)), m_step, SLOT(setCskPassword(QString)));
    connect(m_ui->keystorePassword, SIGNAL(textChanged(QString)),
            m_step, SLOT(setKeystorePassword(QString)));
    connect(m_ui->showPasswords, SIGNAL(toggled(bool)), this, SLOT(showPasswords(bool)));
    connect(m_ui->savePasswords, SIGNAL(toggled(bool)), m_step, SLOT(setSavePasswords(bool)));
    connect(m_ui->qtLibrary, SIGNAL(currentIndexChanged(int)), this, SLOT(setBundleMode(int)));
    connect(m_ui->qtLibrary, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDeployWidgetsState()));
    connect(m_ui->qtLibraryPath, SIGNAL(textChanged(QString)),
            m_step, SLOT(setQtLibraryPath(QString)));
    connect(m_ui->qtLibraryPath, SIGNAL(textChanged(QString)),
            this, SLOT(updateDeployWidgetsState()));
    connect(m_ui->deployNowButton, SIGNAL(clicked()), this, SLOT(deployLibraries()));
    connect(ProjectExplorer::KitManager::instance(), SIGNAL(kitsChanged()), this, SLOT(updateDeployWidgetsState()));

    connect(m_step, SIGNAL(cskPasswordChanged(QString)), m_ui->cskPassword, SLOT(setText(QString)));
    connect(m_step, SIGNAL(keystorePasswordChanged(QString)),
            m_ui->keystorePassword, SLOT(setText(QString)));

    m_ui->signPackages->setChecked(m_step->packageMode() ==
                                   BlackBerryCreatePackageStep::SigningPackageMode);
    m_ui->developmentMode->setChecked(m_step->packageMode() ==
                                      BlackBerryCreatePackageStep::DevelopmentMode);

    m_ui->qtLibrary->setCurrentIndex(m_ui->qtLibrary->findData(m_step->bundleMode()));
    setBundleMode(m_step->bundleMode());
    updateDeployWidgetsState();
}
void MainWindow::openFile(const QString& fileName)
{
	QApplication::setOverrideCursor(Qt::WaitCursor);

	_timeBar->stopClicked();
	
    QFileInfo fileInfo(fileName);
    ReaderWriterILDA reader;

    _lastDirectory = fileInfo.absoluteFilePath();

    _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)
	drawModeChanged();

    // Setup timeline
    _timeBar->setRange(0, _sequence->frameCount() / 1000.0 * 30);
    _timeLine = _timeBar->timeLine();
    _timeLine->setDuration(30 * _sequence->frameCount());
    _timeLine->setFrameRange(0, _sequence->frameCount());
    _timeLine->setCurveShape(QTimeLine::LinearCurve);
    _timeLine->setLoopCount(0);

    // Build the connections
    connect(_timeLine, SIGNAL(frameChanged(int)), _sequence.data(), SLOT(setActiveFrame(int)));
    connect(_sequence.data(), SIGNAL(frameChanged(Frame*)), SLOT(frameChanged(Frame*)));

	// Create scene and attach to graphics view
    QGraphicsScene *scene = new QGraphicsScene();
    scene->addItem(_sequence.data());
    graphicsView->setScene(scene);

    frameChanged(_sequence->frame(0));
    _timeBar->update();

    // FIXME: Need to call this until a resize event happens.
    resizeEvent(0);

	QApplication::restoreOverrideCursor();
}
Exemple #23
0
GenericCodeEditor::GenericCodeEditor( Document *doc, QWidget *parent ):
    QPlainTextEdit( parent ),
    mDoc(doc)
{
    Q_ASSERT(mDoc != 0);

    setFrameShape( QFrame::NoFrame );

    mLineIndicator = new LineIndicator(this);
    mLineIndicator->move( contentsRect().topLeft() );

    mOverlay = new QGraphicsScene(this);

    QGraphicsView *overlayView = new QGraphicsView(mOverlay, this);
    overlayView->setFrameShape( QFrame::NoFrame );
    overlayView->setBackgroundBrush( Qt::NoBrush );
    overlayView->setStyleSheet("background: transparent");
    overlayView->setFocusPolicy( Qt::NoFocus );
    overlayView->setAttribute(Qt::WA_TransparentForMouseEvents, true);
    overlayView->setSceneRect(QRectF(0,0,1,1));
    overlayView->setAlignment(Qt::AlignLeft | Qt::AlignTop);

    mOverlayWidget = overlayView;

    connect( mDoc, SIGNAL(defaultFontChanged()), this, SLOT(onDocumentFontChanged()) );

    connect( this, SIGNAL(blockCountChanged(int)),
             mLineIndicator, SLOT(setLineCount(int)) );

    connect( mLineIndicator, SIGNAL( widthChanged() ),
             this, SLOT( updateLayout() ) );

    connect( this, SIGNAL(updateRequest(QRect,int)),
             this, SLOT(updateLineIndicator(QRect,int)) );

    connect( this, SIGNAL(selectionChanged()),
             mLineIndicator, SLOT(update()) );

    connect( Main::instance(), SIGNAL(applySettingsRequest(Settings::Manager*)),
             this, SLOT(applySettings(Settings::Manager*)) );

    QTextDocument *tdoc = doc->textDocument();
    QPlainTextEdit::setDocument(tdoc);
    onDocumentFontChanged();
    mLineIndicator->setLineCount(blockCount());

    applySettings( Main::settings() );
}
Exemple #24
0
void SumTableView::addItem(TableView* tableview)
{
  tableViews.append(tableview);
  sumTableModel->sumTableData->insertRow(sumTableModel->sumTableData->getRows() - 1, tableview->mappedName);
  connect(tableview->tableModel->tableData, SIGNAL(tableDataChanged(TableData*)),
          this->sumTableModel->sumTableData, SLOT(updateSummedValuesAndRecalculate(TableData*)));
  connect(tableview, SIGNAL(tableColumnActivated(int)),
          this, SLOT(updateCalendar(int)));
  if (tableViews.count() > 0)
  {
    int i = tableViews.count() - 1;
    connect(tableViews.at(0)->horizontalScrollBar(), SIGNAL(valueChanged(int)),
            tableViews.at(i)->horizontalScrollBar(), SLOT(setValue(int)));
    connect(tableViews.at(i)->horizontalScrollBar(), SIGNAL(valueChanged(int)),
            tableViews.at(0)->horizontalScrollBar(), SLOT(setValue(int)));
  }
void StatesEditorWidget::reloadQmlSource()
{
    QString statesListQmlFilePath = qmlSourcesPath() + QStringLiteral("/StatesList.qml");
    QTC_ASSERT(QFileInfo::exists(statesListQmlFilePath), return);
    engine()->clearComponentCache();
    setSource(QUrl::fromLocalFile(statesListQmlFilePath));

    QTC_ASSERT(rootObject(), return);
    connect(rootObject(), SIGNAL(currentStateInternalIdChanged()), m_statesEditorView.data(), SLOT(synchonizeCurrentStateFromWidget()));
    connect(rootObject(), SIGNAL(createNewState()), m_statesEditorView.data(), SLOT(createNewState()));
    connect(rootObject(), SIGNAL(deleteState(int)), m_statesEditorView.data(), SLOT(removeState(int)));
    m_statesEditorView.data()->synchonizeCurrentStateFromWidget();
    setFixedHeight(initialSize().height());

    connect(rootObject(), SIGNAL(expandedChanged()), this, SLOT(changeHeight()));
}
void CCardLabelNexus::registerCardLabel(CCardLabel* label)
{
    if (label)
    {
        connect(
            label, SIGNAL(unitRightClicked(bool)),
            this, SLOT(setCardLabelBlackListStatus(bool)));
        connect(
            label, SIGNAL(unitCtrlRightClicked(bool)),
            this, SLOT(setCardLabelWhiteListStatus(bool)));
        connect(
            this, SIGNAL(pictureDownloaded(const CCard&)),
            label, SLOT(updateCardLabelPicture(const CCard&)));
        label->installEventFilter(this);
    }
}
Exemple #27
0
void DbgMainWindow::updateTypeDisplay()
{
    ItemTreeNode * typeRoot = RsTypeDisplay::build(&rs->getTypeSystem());
    typeModel->setRoot(typeRoot);

    if(typeProxyModel)
        delete typeProxyModel;

    typeProxyModel = new QSortFilterProxyModel(this);
    connect(ui->txtTypeSystemFilter,SIGNAL(textChanged(const QString&)),
            typeProxyModel, SLOT(setFilterWildcard(const QString&)));

    typeProxyModel->setSourceModel(typeModel);

    ui->treeTypeSystem->setModel(typeProxyModel);
}
Exemple #28
0
void DbgMainWindow::updateStackDisplay()
{
    ItemTreeNode * stackRoot = VariablesTypeDisplay::build(&rs->getStackManager());
    stackModel->setRoot(stackRoot);

    if(stackProxyModel)
        delete stackProxyModel;

    stackProxyModel = new QSortFilterProxyModel(this);
    connect(ui->txtStackFilter,SIGNAL(textChanged(const QString&)),
            stackProxyModel, SLOT(setFilterWildcard(const QString&)));

    stackProxyModel->setSourceModel(stackModel);

    ui->treeStack->setModel(stackProxyModel);
}
Exemple #29
0
void WebTab::createPreviewSelectorBar(int index)
{
    if(m_previewSelectorBar.isNull()) {
        m_previewSelectorBar = new PreviewSelectorBar(index, this);
        qobject_cast<QVBoxLayout *>(layout())->insertWidget(0, m_previewSelectorBar.data());
    } else {
        disconnect(m_previewSelectorBar.data());
        m_previewSelectorBar.data()->setIndex(index);
        m_previewSelectorBar.data()->notifyUser();
    }

    connect(page(),             SIGNAL(loadStarted()),      m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
    connect(page(),             SIGNAL(loadProgress(int)),  m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
    connect(page(),             SIGNAL(loadFinished(bool)), m_previewSelectorBar.data(), SLOT(loadFinished()), Qt::UniqueConnection);
    connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)),  m_previewSelectorBar.data(), SLOT(verifyUrl()), Qt::UniqueConnection);
}
Exemple #30
0
void DbgMainWindow::updatePointerDisplay()
{
    ItemTreeNode * pointerRoot = PointerDisplay::build(&rs->getPointerManager());
    pointerModel->setRoot(pointerRoot);

    if(pointerProxyModel)
        delete pointerProxyModel;

    pointerProxyModel = new QSortFilterProxyModel(this);
    connect(ui->txtPointerFilter,SIGNAL(textChanged(const QString&)),
            pointerProxyModel, SLOT(setFilterWildcard(const QString&)));

    pointerProxyModel->setSourceModel(pointerModel);

    ui->treePointer->setModel(pointerProxyModel);
}