本文整理汇总了C++中QScrollBar::move方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollBar::move方法的具体用法?C++ QScrollBar::move怎么用?C++ QScrollBar::move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollBar
的用法示例。
在下文中一共展示了QScrollBar::move方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RebuildEditView
void AvatarEditor::RebuildEditView()
{
if (!avatar_widget_)
return;
// Activate/deactivate export button based on whether export currently supported
QPushButton *button = avatar_widget_->findChild<QPushButton *>("but_export");
if (button)
button->setEnabled(rexlogicmodule_->GetAvatarHandler()->AvatarExportSupported());
QWidget* mat_panel = avatar_widget_->findChild<QWidget *>("panel_materials");
QWidget* attachment_panel = avatar_widget_->findChild<QWidget *>("panel_attachments");
if (!mat_panel || !attachment_panel)
return;
Scene::EntityPtr entity = rexlogicmodule_->GetAvatarHandler()->GetUserAvatar();
if (!entity)
return;
EC_AvatarAppearance* appearance = entity->GetComponent<EC_AvatarAppearance>().get();
if (!appearance)
return;
int width = 308-10;
int tab_width = 302-10;
int itemheight = 20;
// Materials
ClearPanel(mat_panel);
const AvatarMaterialVector& materials = appearance->GetMaterials();
mat_panel->resize(width, itemheight * (materials.size() + 1));
for (uint y = 0; y < materials.size(); ++y)
{
QPushButton* button = new QPushButton("Change", mat_panel);
button->setObjectName(QString::fromStdString(ToString<int>(y))); // Material index
button->resize(50, 20);
button->move(width - 50, y*itemheight);
button->show();
QObject::connect(button, SIGNAL(clicked()), this, SLOT(ChangeTexture()));
// If there's a texture name, use it, because it is probably more understandable than material name
std::string texname = materials[y].asset_.name_;
if (materials[y].textures_.size())
texname = materials[y].textures_[0].name_;
QLabel* label = new QLabel(QString::fromStdString(texname), mat_panel);
label->resize(200,20);
label->move(0, y*itemheight);
label->show();
}
// Attachments
ClearPanel(attachment_panel);
const AvatarAttachmentVector& attachments = appearance->GetAttachments();
attachment_panel->resize(width, itemheight * (attachments.size() + 1));
for (uint y = 0; y < attachments.size(); ++y)
{
QPushButton* button = new QPushButton("Remove", attachment_panel);
button->setObjectName(QString::fromStdString(ToString<int>(y))); // Attachment index
button->resize(50, 20);
button->move(width - 50, y*itemheight);
button->show();
QObject::connect(button, SIGNAL(clicked()), this, SLOT(RemoveAttachment()));
std::string attachment_name = attachments[y].name_;
// Strip away .xml from the attachment name for slightly nicer display
std::size_t pos = attachment_name.find(".xml");
if (pos != std::string::npos)
attachment_name = attachment_name.substr(0, pos);
QLabel* label = new QLabel(QString::fromStdString(attachment_name), attachment_panel);
label->resize(200,20);
label->move(0, y*itemheight);
label->show();
}
// Modifiers
QTabWidget* tabs = avatar_widget_->findChild<QTabWidget *>("tab_appearance");
if (!tabs)
return;
for (;;)
{
QWidget* tab = tabs->widget(0);
if (!tab)
break;
tabs->removeTab(0);
delete tab;
}
const MasterModifierVector& master_modifiers = appearance->GetMasterModifiers();
// If no master modifiers, show the individual morph/bone controls
if (!master_modifiers.size())
{
QWidget* morph_panel = GetOrCreateTabScrollArea(tabs, "Morphs");
QWidget* bone_panel = GetOrCreateTabScrollArea(tabs, "Bones");
if (!morph_panel || !bone_panel)
return;
//.........这里部分代码省略.........