void SvgItem::setSvg(Plasma::Svg *svg) { if (m_svg) { disconnect(m_svg.data(), 0, this, 0); } m_svg = svg; updateDevicePixelRatio(); if (svg) { connect(svg, SIGNAL(repaintNeeded()), this, SLOT(updateNeeded())); connect(svg, SIGNAL(repaintNeeded()), this, SIGNAL(naturalSizeChanged())); connect(svg, SIGNAL(sizeChanged()), this, SIGNAL(naturalSizeChanged())); } if (implicitWidth() <= 0) { setImplicitWidth(naturalSize().width()); } if (implicitHeight() <= 0) { setImplicitHeight(naturalSize().height()); } scheduleImageUpdate(); emit svgChanged(); emit naturalSizeChanged(); }
void MainWindow::setupConnections() { int i; /* Andrea修改 */ //connect( openButton, SIGNAL(clicked()), this, SLOT( launchBMPImport() ) ); 測試用 connect( openBMP, SIGNAL(clicked()), this, SLOT(launchBMPImport()) ); // 按下open BMP 可以讀取圖檔 Andrea connect( openBMP_2, SIGNAL(clicked()), this, SLOT(launchBMPImport()) ); // 按下open BMP 可以讀取圖檔 Andrea 2號用在measure connect( progress, SIGNAL(signalImage(int,QImage)), this, SLOT(displayImage(int,QImage)) ); // 輸出畫面到顯示視窗 connect( filedata, SIGNAL(svgChanged(QString)), pivDisplay_3, SLOT(displaySVG(QString)) ); // 丟svg的方式顯示圖片 (svg暫存在硬碟) 丟到視窗三去做顯示 connect( ScaleW, SIGNAL(valueChanged(int)), settings, SLOT(set_scale_w(int)) ); // 設定 Gauss filter scale w connect( ScaleL, SIGNAL(valueChanged(int)), settings, SLOT(set_scale_l(int)) ); // 設定 Gauss filter scale l connect( measureX, SIGNAL(valueChanged(int)), settings, SLOT(set_measure_X(int)) ); // 設定 Measure的座標X connect( measureY, SIGNAL(valueChanged(int)), settings, SLOT(set_measure_Y(int)) ); // 設定 Measure的座標Y connect( this, SIGNAL(doprocess()), process, SLOT(processBatch()) ); // 進行process的動作 connect( DoFilter, SIGNAL(clicked()), this, SLOT(blob()) ); // 按下按鈕 開始執行blob detector (包含subblob watershed) connect( ChannelButton, SIGNAL(clicked()), this, SLOT(channel()) ); // 抽取指定顏色的通道 connect( FFTJunctionButton, SIGNAL(clicked()), this, SLOT(FFTJunctionProcess()) ); // 按下按鈕 開始執行 FFT Junction Detector connect( SteerJunctionButton, SIGNAL(clicked()), this, SLOT(SteerJunctionProcess()) ); // 按下按鈕 開始執行 Steer Junction Detector connect( EdgeButton, SIGNAL(clicked()), this, SLOT(EdgeProcess()) ); // 按下按鈕 開始執行 Subpixel Edge connect( CornerButton, SIGNAL(clicked()), this, SLOT(CornerProcess()) ); // 按下Corner的按鈕 進行subpixel的Corner計算 //connect( process, SIGNAL(imageThrow(QImage)), pivDisplay, SLOT(displayBMP(QImage)) ); // 計算好 Gauss Filter 將資料丟給顯示 connect( process, SIGNAL(signalsGress(int)), filterProgress, SLOT(setValue(int)) ); // 設定進度條 connect( process, SIGNAL(signalsGress(int)), measureProgress, SLOT(setValue(int)) ); // 設定進度條 connect( process, SIGNAL(signalTabText(int,QString)), this, SLOT(setTabText(int,QString)) ); // 設定進度條 connect( blobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setBlobmethod(int)) ); // 設定現在執行的是哪一個blob detector connect( waterCheck, SIGNAL(stateChanged(int)), this, SLOT(setHighlight(int)) ); // 設定是否要反白 connect( waterCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setWatershed(int)) ); // 設定哪個watershed方法 4.8 4.1 mser // 把訊息印到除錯訊息的地方 append or setText connect( filedata, SIGNAL(debugSignal(QString)), text_debug, SLOT(append(QString)) ); connect( process, SIGNAL(debugSignal(QString)), text_debug, SLOT(append(QString)) ); connect( progress, SIGNAL(debugSignal(QString)), text_debug, SLOT(append(QString)) ); // 這邊跟顯示畫面 pointlist有關 for( i = 0; i < 2; i++ ) connect( display[i], SIGNAL(mousePressed(PIXEL)), this, SLOT(addPixel(PIXEL)) ); // 點擊畫面 更新資料 connect( progress, SIGNAL(updateWidgeB()), pointList[1], SLOT(updatePointList()) ); // 將資料顯示到 point list (output) //connect( pointList[0], SIGNAL(cellClicked(int,int)), this, SLOT(removePointList(int,int)) ); // 點擊 point list (input) 刪除點資料 // 陰影檢測用 改成點擊到的時候顯示該區域到顯示區 connect( pointList[0], SIGNAL(cellClicked(int,int)), this, SLOT(view_square(int,int)) ); connect( removeButton, SIGNAL(clicked()), this, SLOT(remove_square()) ); // 移除某個square connect( clearButton, SIGNAL(clicked()), this, SLOT(clearData()) ); // 按下clear按鈕 清空資料 connect( inhenceCheck, SIGNAL(stateChanged(int)), settings, SLOT(setInhence(int)) ); // 設定inhencement 判斷是抓單點陰影 還是整段的陰影 (應付noise很強 跟noise不強的case) connect( saveCheck, SIGNAL(stateChanged(int)), settings, SLOT(setSaved(int)) ); // 設定是否要將結果輸出到檔案 (image部分) connect( batchCheck, SIGNAL(stateChanged(int)), settings, SLOT(setBatch(int)) ); // 設定是否為批次作業 // Importing // connect(importButton, SIGNAL(clicked()), this, SLOT(launchImageImport())); // connect(filedata, SIGNAL(imagesImported()), this, SLOT(notifyFolderChange())); connect(vectorListWidget, SIGNAL(fileClicked(int)), this, SLOT(vectorClicked(int))); // The following should be moved into settings // connect(colourButtonFiltered, SIGNAL(clicked()), this, SLOT(chooseFilteredColour())); connect(colourButtonUnfiltered, SIGNAL(clicked()), this, SLOT(chooseUnfilteredColour())); connect(scaleSpin, SIGNAL(valueChanged(double)), settings, SLOT(setVectorScale(double))); connect(subSpin, SIGNAL(valueChanged(double)), settings, SLOT(setVectorSub(double))); // Process tab connect(hSizeCombo, SIGNAL(activated(int)), settings, SLOT(setIntLengthX(int))); connect(vSizeCombo, SIGNAL(activated(int)), settings, SLOT(setIntLengthY(int))); connect(hSpaceSpin, SIGNAL(valueChanged(int)), settings, SLOT(setDeltaX(int))); connect(vSpaceSpin, SIGNAL(valueChanged(int)), settings, SLOT(setDeltaY(int))); // DoingPIV connect(outputFolderEdit, SIGNAL(textEdited(QString)), this, SLOT(setOutput())); connect(outputFolderButton, SIGNAL(clicked()), this, SLOT(chooseOutputFolder())); connect(outputFormatCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setOutput())); connect(batchButton, SIGNAL(clicked()), process, SLOT(launchBatchWindow())); connect(process, SIGNAL(batchProcessed()), this, SLOT(batchDone())); //for( i = 0; i < displaySize; i++ ) // connect(display[i], SIGNAL(mousePressed(PIXEL)), this, SLOT(updatePositionPixel(PIXEL))); // Andrea修改 點一下滑鼠,把RGB資訊輸入進去. /*connect(pivDisplay, SIGNAL(mousePressed(QPointF)), this, SLOT(uptdaePositionRGB(QPointF))); // Andrea修改 點一下滑鼠,把RGB資訊輸入進去. connect(pivDisplay_2, SIGNAL(mousePressed(QPointF)), this, SLOT(uptdaePositionRGB(QPointF))); // Andrea修改 點一下滑鼠,把RGB資訊輸入進去. 用在視窗2 connect(pivDisplay, SIGNAL(mousePressed(QPointF)), this, SLOT(updatePositionXY(QPointF))); // Andrea修改 點一下滑鼠,把座標輸入進去. connect(pivDisplay_2, SIGNAL(mousePressed(QPointF)), this, SLOT(updatePositionXY(QPointF))); // Andrea修改 點一下滑鼠,把座標輸入進去. 用在視窗2*/ //connect(pivDisplay, SIGNAL(mousePressed(QPointF)), pivDisplay, SLOT(mark_XY(QPointF))); // Andrea修改 點一下滑鼠, 在上面標記點 //connect(pivDisplay_2, SIGNAL(mousePressed(QPointF)), pivDisplay_2, SLOT(mark_XY(QPointF))); // Andrea修改 點一下滑鼠, 在上面標記點 用在視窗2 connect(this, SIGNAL(set_measure_X(int)), measureX, SLOT(setValue(int) ) ); // 設定 X 座標的spinbox connect(this, SIGNAL(set_measure_Y(int)), measureY, SLOT(setValue(int) ) ); // 設定 Y 座標的spinbox }