資源簡介
自己寫的QT圖像處理系統,和opencv進行了結合,希望有所幫助
代碼片段和文件信息
#include?“aboutninjaform.h“
#include?“ui_aboutninjaform.h“
#include?
AboutNinjaForm::AboutNinjaForm(QWidget?*parent)?:
????QWidget(parent)
????ui(new?Ui::AboutNinjaForm)
{??
????ui->setupUi(this);
????InitAll();
}
//初始化函數
void?AboutNinjaForm::InitAll()
{
????movie?=?new?QMovie(this);
????//緩沖所有幀如果使用了這個就可以使用jumpToframe()跳到指定幀了
????movie->setCacheMode(QMovie::CacheAll);
????movieLabel?=?new?QLabel(tr(“No?movie?loaded“));
????movieLabel->setAlignment(Qt::AlignCenter);
????movieLabel->setSizePolicy(QSizePolicy::Ignored?QSizePolicy::Ignored);
????movieLabel->setBackgroundRole(QPalette::Dark);
????movieLabel->setAutoFillBackground(true);
????currentMovieDirectory?=?“movies“;
????createControls();
????createButtons();
????createNewLabel();
????connect(movie?SIGNAL(frameChanged(int))?this
????????????SLOT(updateframeSlider()));
????connect(movie?SIGNAL(stateChanged(QMovie::MovieState))this
????????????SLOT(updateButtons()));
????connect(fitCheckBox?SIGNAL(clicked())?this
????????????SLOT(fitToWindow()));
????connect(frameSlider?SIGNAL(valueChanged(int))?this
????????????SLOT(goToframe(int)));
????connect(speedSpinBox?SIGNAL(valueChanged(int))movie
????????????SLOT(setSpeed(int)));
????mainLayout?=?new?QVBoxLayout;
????mainLayout->addWidget(movieLabel);
????mainLayout->addLayout(controlsLayout);
????mainLayout->addLayout(buttonsLayout);
????//setLayout(mainLayout);
????NinAllLayout?=new?QHBoxLayout;
????NinAllLayout->addLayout(mainLayout);
????NinAllLayout->addLayout(NewLabelLayout);
????setLayout(NinAllLayout);
????updateframeSlider();
????updateButtons();
????setWindowtitle(tr(“Movie?Player“));
????resize(400?460);
}
void?AboutNinjaForm::open()
{
????QString?fileName?=?QFileDialog::getOpenFileName(this?tr(“Open?a?Movie“)
???????????????????????????????currentMovieDirectory);
????if?(!fileName.isEmpty())
????????openFile(fileName);
}
void?AboutNinjaForm::openFile(const?QString?&fileName)
{
????currentMovieDirectory?=?QFileInfo(fileName).path();
????movie->stop();
????movieLabel->setMovie(movie);
????movie->setFileName(fileName);
????movie->start();
}
void?AboutNinjaForm::createControls()
{
????//是否適應窗口
????fitCheckBox?=?new?QCheckBox(tr(“Fit?to?Window“));
????frameLabel?=?new?QLabel(tr(“Current?frame:“));
????frameSlider?=?new?QSlider(Qt::Horizontal);
????frameSlider->setTickPosition(QSlider::TicksBothSides);//箭頭方向
????frameSlider->setTickInterval(10);//相鄰檔之間的間隔
????speedLabel?=?new?QLabel(tr(“Speed:“));
????speedSpinBox?=?new?QSpinBox;
????speedSpinBox->setRange(1?9999);
????speedSpinBox->setValue(100);
????speedSpinBox->setSuffix(tr(“%“));
????controlsLayout?=?new?QGridLayout;
????controlsLayout->addWidget(fitCheckBox?0?0?1?2);
????controlsLayout->addWidget(frameLabel?1?0);
????controlsLayout->addWidget(frameSlider?1?1?1?2);
????controlsLayout->addWidget(speedLabel?2?0);
????controlsLayout->add
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4465??2011-02-23?18:06??QScarletNinjaSystem\523614.png
?????文件???????7025??2017-07-24?20:34??QScarletNinjaSystem\aboutninjaform.cpp
?????文件???????1535??2017-07-24?19:54??QScarletNinjaSystem\aboutninjaform.h
?????文件????????412??2017-07-24?21:50??QScarletNinjaSystem\aboutninjaform.ui
?????文件??????77789??2017-07-24?09:49??QScarletNinjaSystem\gif\codemonkey.gif
?????文件??????83206??2017-07-24?09:48??QScarletNinjaSystem\gif\CodeRain.gif
?????文件??????53425??2017-07-24?09:51??QScarletNinjaSystem\gif\gear.gif
?????文件????2080416??2017-07-24?09:47??QScarletNinjaSystem\gif\MagicArray.gif
?????文件????1859913??2017-07-24?09:46??QScarletNinjaSystem\gif\MagicArray2.gif
?????文件?????253546??2017-07-24?09:45??QScarletNinjaSystem\gif\MagicArray3.gif
?????文件?????380910??2017-07-24?09:46??QScarletNinjaSystem\gif\Necklace.gif
?????文件?????773929??2017-07-24?09:45??QScarletNinjaSystem\gif\PrimalRoar.gif
?????文件?????667499??2017-07-24?09:52??QScarletNinjaSystem\gif\tesseract.gif
?????文件????1596291??2017-07-24?09:52??QScarletNinjaSystem\gif\tesseract2.gif
?????文件????1208099??2017-07-24?09:53??QScarletNinjaSystem\gif\tesseract3.gif
?????文件????2006297??2017-07-24?09:47??QScarletNinjaSystem\gif\TohsakaRin.gif
?????文件????2093947??2017-07-24?09:46??QScarletNinjaSystem\gif\TohsakaRin2.gif
?????文件????????201??2017-07-22?15:48??QScarletNinjaSystem\main.cpp
?????文件???????7309??2017-07-29?18:03??QScarletNinjaSystem\qcv_class.cpp
?????文件???????4725??2017-07-29?16:02??QScarletNinjaSystem\qcv_class.h
?????文件??????27102??2017-07-26?20:31??QScarletNinjaSystem\qico\BTHorn.png
?????文件??????26259??2017-07-26?20:32??QScarletNinjaSystem\qico\BTOrigion.png
?????文件??????28492??2017-07-26?20:32??QScarletNinjaSystem\qico\BTPress.png
?????文件?????108934??2017-07-23?11:00??QScarletNinjaSystem\qico\funny.png
?????文件???????2371??2016-11-07?09:38??QScarletNinjaSystem\qico\ico\10-Ninja.png
?????文件???????3748??2012-03-28?22:48??QScarletNinjaSystem\qico\ico\1061551.png
?????文件???????4709??2012-03-28?22:48??QScarletNinjaSystem\qico\ico\1061552.png
?????文件???????3672??2012-03-28?22:48??QScarletNinjaSystem\qico\ico\1061554.png
?????文件???????1750??2012-03-28?22:48??QScarletNinjaSystem\qico\ico\1061556.png
?????文件???????5056??2012-03-28?22:48??QScarletNinjaSystem\qico\ico\1061563.png
............此處省略347個文件信息
評論
共有 條評論