本文整理汇总了C++中QMovie::setParent方法的典型用法代码示例。如果您正苦于以下问题:C++ QMovie::setParent方法的具体用法?C++ QMovie::setParent怎么用?C++ QMovie::setParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMovie
的用法示例。
在下文中一共展示了QMovie::setParent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
BusyDialog::BusyDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::BusyDialog)
{
ui->setupUi(this);
setWindowFlags(Qt::Popup);
QMovie *movie = new QMovie(":/loading.gif");
movie->setParent(this);
movie->setSpeed(50);// 50%
movie->setScaledSize(QSize(64, 64));
ui->labelGif->setMovie(movie);
}
示例2: Dialog
SVNCommitDialog::SVNCommitDialog(QWidget *parent, const QString &workingDir,
const QStringList &files, bool folderOnly,
int sceneIconAdded)
: Dialog(TApp::instance()->getMainWindow(), true, false)
, m_commitSceneContentsCheckBox(0)
, m_workingDir(workingDir)
, m_files(files)
, m_folderOnly(folderOnly)
, m_targetTempFile(0)
, m_selectionCheckBox(0)
, m_selectionLabel(0)
, m_sceneIconAdded(sceneIconAdded)
, m_folderAdded(0) {
setModal(false);
setAttribute(Qt::WA_DeleteOnClose, true);
setWindowTitle(tr("Version Control: Put changes"));
if (m_folderOnly)
setMinimumSize(320, 320);
else
setMinimumSize(300, 180);
QWidget *container = new QWidget;
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->setAlignment(Qt::AlignHCenter);
mainLayout->setMargin(0);
m_treeWidget = new QTreeWidget;
m_treeWidget->header()->hide();
m_treeWidget->hide();
if (m_folderOnly) {
m_treeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_treeWidget->setIconSize(QSize(21, 17));
}
m_treeWidget->setStyleSheet("QTreeWidget { border: 1px solid gray; }");
if (m_folderOnly) {
mainLayout->addWidget(m_treeWidget);
QHBoxLayout *belowTreeLayout = new QHBoxLayout;
belowTreeLayout->setMargin(0);
m_selectionCheckBox = new QCheckBox(tr("Select / Deselect All"), 0);
connect(m_selectionCheckBox, SIGNAL(clicked(bool)), this,
SLOT(onSelectionCheckBoxClicked(bool)));
m_selectionLabel = new QLabel;
m_selectionLabel->setText(tr("0 Selected / 0 Total"));
m_selectionCheckBox->hide();
m_selectionLabel->hide();
belowTreeLayout->addWidget(m_selectionCheckBox);
belowTreeLayout->addStretch();
belowTreeLayout->addWidget(m_selectionLabel);
mainLayout->addLayout(belowTreeLayout);
}
QHBoxLayout *hLayout = new QHBoxLayout;
m_waitingLabel = new QLabel;
QMovie *waitingMove = new QMovie(":Resources/waiting.gif");
waitingMove->setParent(this);
m_waitingLabel->setMovie(waitingMove);
waitingMove->setCacheMode(QMovie::CacheAll);
waitingMove->start();
m_textLabel = new QLabel;
m_textLabel->setText(tr("Getting repository status..."));
hLayout->addStretch();
hLayout->addWidget(m_waitingLabel);
hLayout->addWidget(m_textLabel);
hLayout->addStretch();
mainLayout->addLayout(hLayout);
if (!m_folderOnly)
mainLayout->addWidget(m_treeWidget);
else
mainLayout->addSpacing(10);
QFormLayout *formLayout = new QFormLayout;
formLayout->setLabelAlignment(Qt::AlignRight);
formLayout->setFormAlignment(Qt::AlignHCenter | Qt::AlignTop);
formLayout->setSpacing(10);
formLayout->setMargin(0);
m_commentTextEdit = new QPlainTextEdit;
m_commentTextEdit->setMaximumHeight(50);
m_commentTextEdit->hide();
m_commentLabel = new QLabel(tr("Comment:"));
m_commentLabel->setFixedWidth(55);
m_commentLabel->hide();
//.........这里部分代码省略.........