当前位置: 首页>>代码示例>>C++>>正文


C++ QStackedLayout::setContentsMargins方法代码示例

本文整理汇总了C++中QStackedLayout::setContentsMargins方法的典型用法代码示例。如果您正苦于以下问题:C++ QStackedLayout::setContentsMargins方法的具体用法?C++ QStackedLayout::setContentsMargins怎么用?C++ QStackedLayout::setContentsMargins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QStackedLayout的用法示例。


在下文中一共展示了QStackedLayout::setContentsMargins方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QDialog

EventDetailsDialog::EventDetailsDialog(const SeafEvent& event, QWidget *parent)
    : QDialog(parent),
      event_(event)
{
    setWindowTitle(tr("Modification Details"));
    setWindowIcon(QIcon(":/images/seafile.png"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

    QStackedLayout *layout = new QStackedLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    setLayout(layout);

    loading_view_ = new LoadingView;
    layout->addWidget(loading_view_);

    tree_ = new EventDetailsListView(event);
    model_ = new EventDetailsListModel(event);
    tree_->setModel(model_);

    layout->addWidget(tree_);

    request_ = 0;

    sendRequest();
}
开发者ID:DevCybran,项目名称:seafile-client,代码行数:25,代码来源:event-details-dialog.cpp

示例2: QDialog

SettingDialog::SettingDialog(QWidget *parent):
    QDialog(parent)
//    , m_settingLayout(new QVBoxLayout(this))
//    , m_stackedWidget(new QStackedWidget)
//    , m_okBtn(new QPushButton(this))
{
    this->setWindowFlags(Qt::FramelessWindowHint);
    this->setFixedSize(479, 421);
    this->setFocusPolicy(Qt::ClickFocus);
    this->setWindowTitle(tr("Kylin Weather - Setting"));
    this->setWindowIcon(QIcon(":/res/indicator-china-weather.png"));
    //Why????? setStyleSheet将导致添加城市后,列表没有自动拉伸,出现重叠,但是qDebug打印的高度确实增加了,但是使用paintEvent可以
    //this->setStyleSheet("QDialog{border:1px solid #000000;border-radius:2px;background:rgba(255, 255, 255, 0.7);}QDialog:hover{background: rgba(255, 255, 255, 1.0);}");


    initSettings();
    initSearch();

    QStackedLayout *contentLayout = new QStackedLayout(this);
    contentLayout->setContentsMargins(20, 20, 20, 20);
    contentLayout->setMargin(0);
    contentLayout->setSpacing(0);
    contentLayout->addWidget(m_settingFrame);
    contentLayout->addWidget(m_searchFrame);
    m_settingFrame->setVisible(true);
}
开发者ID:UbuntuKylin,项目名称:indicator-china-weather,代码行数:26,代码来源:settingdialog.cpp

示例3: QWidget

Speed::Speed(QWidget *parent): QWidget(parent)
{
	QHBoxLayout *layout = new QHBoxLayout();
	layout->setSpacing(0);
	layout->setMargin(0);
	
	setStyleSheet("padding: 0;");
	
		QVBoxLayout *contentLayout = new QVBoxLayout();
		contentLayout->setSpacing(2);
		contentLayout->setMargin(0);
		contentLayout->setContentsMargins(0, 2, 0, 0);
		
		QWidget *content = new QWidget();
		content->setLayout(contentLayout);
		content->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
			
			QStackedLayout *speedometerLayout = new QStackedLayout(contentLayout);
			speedometerLayout->setSpacing(2);
			speedometerLayout->setMargin(0);
			speedometerLayout->setContentsMargins(0, 2, 0, 0);
			speedometerLayout->setStackingMode(QStackedLayout::StackAll);
			
			speedometerNeedle = new RotatableImageView(":/resources/speedometer-needle_160x160.png");
			speedometerNeedle->rotate(-129);
			speedometerLayout->addWidget(speedometerNeedle);
			
			QLabel *speedometer = new QLabel();
			speedometer->setPixmap(QPixmap(":/resources/speedometer_160x160.png"));
			speedometer->setMargin(2);
			speedometerLayout->addWidget(speedometer);
			
			speedometerLabel = new QLabel("N/A");
			speedometerLabel->setAlignment(Qt::AlignCenter);
			speedometerLabel->setStyleSheet("font: 13pt; font-weight: bold;");
			contentLayout->addWidget(speedometerLabel);
		
		TitledBox *box = new TitledBox(tr("Speed"), content);
		layout->addWidget(box);
		
	QGraphicsDropShadowEffect *dropShadow = new QGraphicsDropShadowEffect();
	dropShadow->setBlurRadius(6);
	dropShadow->setColor(QColor(0, 0, 0));
	dropShadow->setOffset(0, 0);
	
	setGraphicsEffect(dropShadow);
	
	setLayout(layout);
}
开发者ID:Jlaird,项目名称:AutoFlight_v1,代码行数:49,代码来源:speed.cpp

示例4: QWidget

toResultPlanAbstr::toResultPlanAbstr(QWidget *parent)
	: QWidget(parent)
	, CursorChildSel(NULL)
	, DisplayChildCombo(false)
	, Explaining(false)
	, Query(NULL)
{
    using namespace ToConfiguration;
    planTreeView = new toResultPlanView(this);
    planTreeText = new QPlainTextEdit(this);
    planTreeText->setReadOnly(true);
    planTreeText->setFont(Utils::toStringToFont(toConfigurationNewSingle::Instance().option(Editor::ConfTextFont).toString()));

    //toExplainTypeButtonSingle::Instance().
    QStackedLayout  *mainLayout = new QStackedLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0, 0, 0, 0);

    mainLayout->addWidget(planTreeView);
    mainLayout->addWidget(planTreeText);
    mainLayout->setCurrentIndex(0);
    //mainLayout->setStackingMode(QStackedLayout::StackAll);
    setLayout(mainLayout);
}
开发者ID:Daniel1892,项目名称:tora,代码行数:24,代码来源:toresultplan.cpp


注:本文中的QStackedLayout::setContentsMargins方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。