本文整理汇总了C++中LinearLayout::addStretch方法的典型用法代码示例。如果您正苦于以下问题:C++ LinearLayout::addStretch方法的具体用法?C++ LinearLayout::addStretch怎么用?C++ LinearLayout::addStretch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinearLayout
的用法示例。
在下文中一共展示了LinearLayout::addStretch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Scene
GameMenuScene::GameMenuScene(Stage* stage, QGraphicsItem* parent)
: Scene(mapSceneName(sceneGameMenu), stage, parent)
{
setBackground("gm_background");
LinearLayout* leftLayout = new LinearLayout(Qt::Vertical);
Actor* gameTitle = new Actor("ge_game_title", this);
gameTitle->setPaddings(0.1);
leftLayout->addItem(gameTitle, 0.2);
LinearLayout* centralLayout = new LinearLayout(Qt::Horizontal);
leftLayout->addLayout(centralLayout, 0.8);
Actor* robot = new Actor("ge_robot", this);
robot->setPaddings(0.2);
centralLayout->addItem(robot, 0.5);
robot->alignCenter();
centralLayout->addStretch(0.5);
LinearLayout* rightLayout = new LinearLayout(Qt::Vertical);
setupButtons(rightLayout);
LinearLayout* globalLayout = new LinearLayout(Qt::Horizontal);
globalLayout->addLayout(leftLayout, 0.7);
globalLayout->addLayout(rightLayout, 0.3);
setLayout(globalLayout);
// This is the last scene loaded
QSettings settings;
settings.setValue( sk("Application/LastScene"), sceneName );
}