MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), openShortcut(QKeySequence::Open, this, SLOT(onOpenFile())), m_currentH264Model(NULL) { ui->setupUi(this); connect(ui->openPushButton, SIGNAL(clicked()), this, SLOT(onOpenFile())); connect(ui->nalTableView, SIGNAL(clicked(QModelIndex)), this, SLOT(onNalTableItemClicked(QModelIndex))); }
DialogRecepti::DialogRecepti(QWidget *parent) : QDialog(parent), ui(new Ui::DialogRecepti) { ui->setupUi(this); ui->listWidget->setSelectionMode(QAbstractItemView::SingleSelection); connect(ui->btnOpenFile,SIGNAL(clicked()),this,SLOT(onOpenFile())); connect(ui->btnExit,SIGNAL(clicked()),this,SLOT(onExit())); char * fn = new char[40]; strcpy(fn,"/sdcard/recepti/recepti.bet"); dict = iniparser_load(fn); if(dict == NULL) { QMessageBox::information(this,"iniparser library",QString("Failed to load dictionary from file:\n%1").arg(fn)); return; } int n = iniparser_getnsec(dict); //QMessageBox::information(this,QString("iniparser"),QString("%1 sections found from file: %2").arg(n).arg(fn)); if(n>0) { for(int i =0 ; i<n ; i++) { QString str(iniparser_getsecname(dict,i)); ui->listWidget->addItem(str.toUpper()); } ui->listWidget->item(0)->setSelected(true); } }
void MainWindow::createActions() { openAction = new QAction(tr("打开文件"),this); connect(openAction,SIGNAL(triggered()),this,SLOT(onOpenFile())); openAction->setShortcut(QKeySequence::New); rgb2Gray = new QAction(tr("转换成灰度图片"),this); connect(rgb2Gray,SIGNAL(triggered()),this,SLOT(onRgb2Gray())); rgb2Gray->setEnabled(false); exitAction = new QAction(tr("退出"),this); exitAction->setShortcut(QKeySequence::Quit); connect(exitAction,SIGNAL(triggered()),this,SLOT(close())); histogramAction = new QAction(tr("灰度直方图"),this); connect(histogramAction,SIGNAL(triggered()),this,SLOT(onHistogramAction())); linerTransformAction = new QAction(tr("灰度的线性变换"),this); connect(linerTransformAction,SIGNAL(triggered()),this,SLOT(onLinearTransform())); extendAction = new QAction(tr("灰度拉伸"),this); connect(extendAction,SIGNAL(triggered()),this,SLOT(onGrayExtend())); equalAction = new QAction(tr("灰度均衡"),this); connect(equalAction,SIGNAL(triggered()),this,SLOT(onEqualAction())); thresholdAction = new QAction(tr("阈值变换"),this); connect(thresholdAction,SIGNAL(triggered()),this,SLOT(thresholdChangeAction())); translationAction = new QAction(tr("图像的平移 "),this); connect(translationAction,SIGNAL(triggered()),this,SLOT(onTranslationAction())); hMirroredAction = new QAction(tr("图像的水平镜像变换"),this); connect(hMirroredAction,SIGNAL(triggered()),this,SLOT(onHMirroredTran())); vMirroredAction = new QAction(tr("图像的垂直镜像变换"),this); connect(vMirroredAction,SIGNAL(triggered()),this,SLOT(onVMirroredTran())); transpositionAction = new QAction(tr("图像转置"),this); connect(transpositionAction,SIGNAL(triggered()),this,SLOT(onTranposition())); zoomAction = new QAction(tr("图像缩放"),this); connect(zoomAction,SIGNAL(triggered()),this,SLOT(onZoomImage())); smoothAction = new QAction(tr("图像平滑"),this); connect(smoothAction,SIGNAL(triggered()),this,SLOT(onSmoothOperation())); middleFilterAction = new QAction(tr("中值滤波"),this); connect(middleFilterAction,SIGNAL(triggered()),this,SLOT(onMiddleFilterAction())); gradientSharpenAction = new QAction(tr("梯度锐化"),this); connect(gradientSharpenAction,SIGNAL(triggered()),this,SLOT(onGradientSharpen())); laplaceSharpenAction = new QAction(tr("拉普拉斯锐化"),this); connect(laplaceSharpenAction,SIGNAL(triggered()),this,SLOT(onLaplaceSharpen())); roberts = new QAction(tr("Roberts算子"),this); connect(roberts,SIGNAL(triggered()),this,SLOT(onRobertsEdgeDect())); sobel = new QAction(tr("Sobel算子"),this); connect(sobel,SIGNAL(triggered()),this,SLOT(onSobelEdgeDect())); prewitt = new QAction(tr("prewitt算子"),this); connect(prewitt,SIGNAL(triggered()),this,SLOT(onPrewittEdgeDect())); krisch = new QAction(tr("krisch算子"),this); connect(krisch,SIGNAL(triggered()),this,SLOT(onKrischEdgeDect())); // gaslap = new QAction(tr("高斯拉普拉斯算子"),this); // connect(gaslap,SIGNAL(triggered()),this,SLOT(onGasLapEdgeDect())); aboutAuthorAction = new QAction(tr("作者"),this); connect(aboutAuthorAction,SIGNAL(triggered()),this,SLOT(onAbout())); }
CXIniFileEditor::CXIniFileEditor() //: { setupUi(this); // mIsUpload = false; // mProgressBar = NULL; mHighlighter = new CXIniSyntaxHighlighter(mIniFileEdit->document()); mModel = new QFileSystemModel(this); mModel->setNameFilterDisables(false); mModel->setFilter(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot); mIniFileView->setModel(mModel); mIniFileView->setRootIndex(mModel->setRootPath(/*QApplication::applicationDirPath() + */"jini")); //QIcon icon; icon.addFile(QString::fromUtf8(":/images/down.png"), QSize(), QIcon::Normal, QIcon::Off); btnDown->setIcon(QIcon(":/images/down.png")); btnDown->setIconSize(QSize(24, 24)); btnDown->setAutoRepeat(true); btnDown->setAutoRepeatInterval(100); btnUp->setIcon(QIcon(":/images/up.png")); btnUp->setIconSize(QSize(24, 24)); btnUp->setAutoRepeat(true); btnUp->setAutoRepeatInterval(100); btnLoad->setIcon(QIcon(":/images/open_folder.png")); btnLoad->setIconSize(QSize(24, 24)); btnLoad->setAutoRepeat(true); btnLoad->setAutoRepeatInterval(100); connect(btnDown, SIGNAL(clicked()), this, SLOT(onDownList())); connect(btnUp, SIGNAL(clicked()), this, SLOT(onUpList())); connect(btnLoad, SIGNAL(clicked()), this, SLOT(onOpenFile())); connect(mIniFileView, SIGNAL(activated(const QModelIndex&)), this, SLOT(onItemActivate(const QModelIndex&))); connect(this, SIGNAL(fileOpened(const QModelIndex&)), this, SLOT(onItemActivate(const QModelIndex&))); //registerManager(); }
GraphicStripSyncTestWindow::GraphicStripSyncTestWindow(GraphicStripSyncTestSettings *settings) : PhDocumentWindow(settings), ui(new Ui::GraphicStripSyncTestWindow), _settings(settings), _sonySlave(PhTimeCodeType25, _settings) { ui->setupUi(this); _strip = ui->stripView->strip(); _strip->setSettings(_settings); _doc = _strip->doc(); _clock = _strip->clock(); _clockSynchroniser.setStripClock(_clock); connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(onOpenFile())); connect(_clock, SIGNAL(frameChanged(PhFrame, PhTimeCodeType)), this, SLOT(onFrameChanged(PhFrame, PhTimeCodeType))); connect(_clock, SIGNAL(rateChanged(PhRate)), this, SLOT(onRateChanged(PhRate))); if(_sonySlave.open()) { _clock = _sonySlave.clock(); _clockSynchroniser.setSonyClock(_clock); connect(ui->stripView, SIGNAL(beforePaint(int)), &_sonySlave, SLOT(checkVideoSync(int))); }
void CXIniFileEditor::reloadFiles() { onOpenFile(mFileName); }
void CXIniFileEditor::onItemActivate(const QModelIndex& aIndex) { mFileName = mModel->filePath(aIndex); onOpenFile(mFileName); }