Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added dialog to adjust frame spacing for imported image sequence
- Loading branch information
Showing
5 changed files
with
111 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#include <QtWidgets> | ||
#include <QSpinBox> | ||
#include <QGridLayout> | ||
#include <QGroupBox> | ||
|
||
#include "imageseqdialog.h" | ||
#include "editor.h" | ||
#include "util.h" | ||
|
||
ImageSeqDialog::ImageSeqDialog(QWidget* parent ) : QDialog(parent) | ||
{ | ||
setWindowTitle(tr("Image Sequence Dialog")); | ||
setFixedSize(300,180); | ||
} | ||
|
||
void ImageSeqDialog::init() | ||
{ | ||
QVBoxLayout* lay = new QVBoxLayout; | ||
QPushButton *okButton = new QPushButton(tr("OK")); | ||
QPushButton *closeButton = new QPushButton(tr("Cancel")); | ||
|
||
QGroupBox* sequenceBox = new QGroupBox(); | ||
QHBoxLayout* buttonsLayout = new QHBoxLayout; | ||
|
||
sequenceBoxLabel = new QLabel(this); | ||
sequenceBoxLabel->setText(tr("Import an image every # frame")); | ||
|
||
mSequenceSpaceBox = new QSpinBox(this); | ||
mSequenceSpaceBox->setRange(1,64); | ||
mSequenceSpaceBox->setValue( 1 ); | ||
|
||
QGridLayout* gridLayout = new QGridLayout(); | ||
sequenceBox->setLayout(gridLayout); | ||
|
||
connect(closeButton, &QAbstractButton::clicked, this, &QDialog::reject); | ||
connect(okButton, &QAbstractButton::clicked, this, &QDialog::accept); | ||
connect(mSequenceSpaceBox, SIGNAL(valueChanged(int)), this, SLOT(setSeqValue(int))); | ||
|
||
buttonsLayout->addWidget(okButton); | ||
buttonsLayout->addWidget(closeButton); | ||
|
||
gridLayout->addWidget(sequenceBoxLabel, 0, 0); | ||
gridLayout->addWidget(mSequenceSpaceBox, 1, 0); | ||
|
||
lay->addWidget(sequenceBox); | ||
lay->addLayout(buttonsLayout); | ||
|
||
setLayout(lay); | ||
} | ||
|
||
void ImageSeqDialog::setSeqValue(int number) | ||
{ | ||
SignalBlocker b1( mSequenceSpaceBox ); | ||
mSequenceSpaceBox->setValue(number); | ||
} | ||
|
||
void ImageSeqDialog::seqNumber(QString strImgFile, Editor *mEditor) | ||
{ | ||
int number = mSequenceSpaceBox->value(); | ||
|
||
mEditor->importImage( strImgFile ); | ||
for (int i = 1; i < number; i++) | ||
{ | ||
mEditor->scrubForward(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef IMAGESEQDIALOG_H | ||
#define IMAGESEQDIALOG_H | ||
|
||
#include <QDialog> | ||
|
||
class QSpinBox; | ||
class QLabel; | ||
class QGridLayout; | ||
class QGroupBox; | ||
class Editor; | ||
|
||
class ImageSeqDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
ImageSeqDialog(QWidget *parent); | ||
|
||
void init(); | ||
void seqNumber(QString strImgFile, Editor *mEditor); | ||
|
||
public slots: | ||
void setSeqValue(int number); | ||
|
||
private: | ||
void createIcons(); | ||
|
||
QSpinBox *mSequenceSpaceBox; | ||
QLabel *sequenceBoxLabel; | ||
}; | ||
|
||
#endif // IMAGESEQDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters