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


C++ setMargin函数代码示例

本文整理汇总了C++中setMargin函数的典型用法代码示例。如果您正苦于以下问题:C++ setMargin函数的具体用法?C++ setMargin怎么用?C++ setMargin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: SidePanel

TracksPanel::TracksPanel(QWidget *parent) :
    SidePanel("Tracks", parent),
    d(new TracksPanelPrivate(this)) {

    d->tracks_bus = new TracksBus;
    d->tracks_list = new QWidget;

    auto layout0 = new QVBoxLayout;
    layout0->setMargin(0);
    layout0->setSpacing(0);
    for(int i = 0; i < 16; ++i) {
        layout0->addWidget(new TracksItem);
    }
    layout0->addStretch();
    d->tracks_list->setLayout(layout0);

    auto scroll_area = new QScrollArea;
    scroll_area->setWidgetResizable(true);
    scroll_area->setWidget(d->tracks_list);
    scroll_area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    auto layout = new QVBoxLayout;
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addWidget(d->tracks_bus);
    layout->addWidget(scroll_area);

    this->centralWidget()->setLayout(layout);
}
开发者ID:ProjRoca,项目名称:RocaEditor,代码行数:29,代码来源:tracks_panel.cpp

示例2: QFrame

void ResourceDock::setupHTools() {
	auto htools = new QFrame(this);
	auto vlayout = new QVBoxLayout(htools);
	vlayout->setMargin(2);
	vlayout->setSpacing(0);

	auto hlayoutTitle = new QHBoxLayout();
	auto title = new QLabel(htools);
	title->setText("Resource Explorer ");
	title->setStyleSheet("color: lightGray;");
	hlayoutTitle->addWidget(title);

	auto sepBrush = QBrush(Qt::gray, Qt::BrushStyle::Dense6Pattern);
	QPalette sepPalette;
	sepPalette.setBrush(QPalette::Background, sepBrush);

	auto seprator = new QLabel(htools);
	seprator->setAutoFillBackground(true);
	seprator->setPalette(sepPalette);
	seprator->setMaximumHeight(10);
	hlayoutTitle->addWidget(seprator, 1, Qt::AlignBottom);

	auto btnClose = new QToolButton(htools);
	btnClose->setText("X");
	btnClose->setStyleSheet("color: lightGray\n");
	btnClose->setAutoRaise(true);
	btnClose->setMaximumWidth(16);
	btnClose->setMaximumHeight(16);
	hlayoutTitle->addWidget(btnClose);
	connect(btnClose, &QToolButton::clicked, this, &QDockWidget::hide);

	vlayout->addLayout(hlayoutTitle);
	vlayout->addSpacing(2);

	auto hlayoutTools = new QHBoxLayout();
	hlayoutTools->setMargin(0);
	hlayoutTools->setSpacing(0);

	auto btnCollAll = new QToolButton(htools);
	btnCollAll->setIcon(QIcon(":/icons/col"));
	btnCollAll->setToolTip("Collapse All");
	btnCollAll->setToolButtonStyle(Qt::ToolButtonIconOnly);
	connect(btnCollAll, &QToolButton::clicked, resTree, &QTreeWidget::collapseAll);
	hlayoutTools->addWidget(btnCollAll);
	hlayoutTools->addSpacing(5);

	auto ledit = new QLineEdit(htools);
	ledit->setPlaceholderText("Search");
	ledit->addAction(QIcon(":/icons/search"), QLineEdit::ActionPosition::TrailingPosition);
	ledit->setStyleSheet("background-color: gray;");
	connect(ledit, &QLineEdit::textChanged, this, &ResourceDock::searchAct);
	hlayoutTools->addWidget(ledit, 1);
	vlayout->addLayout(hlayoutTools);

	htools->setLayout(vlayout);

	setTitleBarWidget(htools);
}
开发者ID:MrMilad,项目名称:Kite2D,代码行数:58,代码来源:resourcedock.cpp

示例3: m_aspect

EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWidget *additionalWidget) :
    m_aspect(aspect),
    m_additionalWidget(additionalWidget)
{
    QTC_CHECK(m_aspect);

    setContentsMargins(0, 0, 0, 0);
    auto topLayout = new QVBoxLayout(this);
    topLayout->setMargin(0);

    auto baseEnvironmentWidget = new QWidget;
    auto baseLayout = new QHBoxLayout(baseEnvironmentWidget);
    baseLayout->setMargin(0);
    auto label = new QLabel(tr("Base environment for this run configuration:"), this);
    baseLayout->addWidget(label);
    m_baseEnvironmentComboBox = new QComboBox;
    QList<int> bases = m_aspect->possibleBaseEnvironments();
    int currentBase = m_aspect->baseEnvironmentBase();
    QString baseDisplayName;
    foreach (int i, bases) {
        const QString displayName = m_aspect->baseEnvironmentDisplayName(i);
        m_baseEnvironmentComboBox->addItem(displayName, i);
        if (i == currentBase) {
            m_baseEnvironmentComboBox->setCurrentIndex(m_baseEnvironmentComboBox->count() - 1);
            baseDisplayName = displayName;
        }
    }
    if (m_baseEnvironmentComboBox->count() == 1)
        m_baseEnvironmentComboBox->setEnabled(false);

    connect(m_baseEnvironmentComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
            this, &EnvironmentAspectWidget::baseEnvironmentSelected);

    baseLayout->addWidget(m_baseEnvironmentComboBox);
    baseLayout->addStretch(10);
    if (additionalWidget)
        baseLayout->addWidget(additionalWidget);

    m_environmentWidget = new EnvironmentWidget(this, baseEnvironmentWidget);
    m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment());
    m_environmentWidget->setBaseEnvironmentText(baseDisplayName);
    m_environmentWidget->setUserChanges(m_aspect->userEnvironmentChanges());
    m_environmentWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    topLayout->addWidget(m_environmentWidget);

    connect(m_environmentWidget, &EnvironmentWidget::userChangesChanged,
            this, &EnvironmentAspectWidget::userChangesEdited);

    connect(m_aspect, &EnvironmentAspect::baseEnvironmentChanged,
            this, &EnvironmentAspectWidget::changeBaseEnvironment);
    connect(m_aspect, &EnvironmentAspect::userEnvironmentChangesChanged,
            this, &EnvironmentAspectWidget::changeUserChanges);
    connect(m_aspect, &EnvironmentAspect::environmentChanged,
            this, &EnvironmentAspectWidget::environmentChanged);
}
开发者ID:kai66673,项目名称:qt-creator,代码行数:55,代码来源:environmentaspectwidget.cpp

示例4: RigidSceneObject

BSPSceneObject::BSPSceneObject(char * filename, int curveTesselation) : RigidSceneObject()
{
	hasVisibility = true;
	
	bspObject = new BSP();
	bspObject->Load(filename,curveTesselation);
	bspObject->buildSingleCluster();
	
	bind(bspObject->clusterObject);
	
	//		bspObject->disableVIS(true);
	//		bspObject->showAll(true);
	
	setMass(0);
	setMargin(0.01f);
	createRigidBody();
	mRigidBody->setActivationState(WANTS_DEACTIVATION); 
	
	segmentMask = new BITSET;
	segmentMask->Init(bspObject->clusterObject.numSegments);
	segmentMask->SetAll();
	
//	createRigidBody();
//	colShape->setMargin(0.005);
}
开发者ID:PH3NIX,项目名称:CubicVR,代码行数:25,代码来源:BSPSceneObject.cpp

示例5: KHBox

RatingFilter::RatingFilter(QWidget* const parent)
    : KHBox(parent), d(new Private)
{
    d->ratingWidget = new RatingFilterWidget(this);

    d->optionsBtn   = new QToolButton(this);
    d->optionsBtn->setToolTip( i18n("Rating Filter Options"));
    d->optionsBtn->setIcon(KIconLoader::global()->loadIcon("configure", KIconLoader::Toolbar));
    d->optionsBtn->setPopupMode(QToolButton::InstantPopup);

    d->optionsMenu  = new KMenu(d->optionsBtn);
    d->geCondAction = d->optionsMenu->addAction(i18n("Greater Than or Equals Condition"));
    d->geCondAction->setCheckable(true);
    d->eqCondAction = d->optionsMenu->addAction(i18n("Equals Condition"));
    d->eqCondAction->setCheckable(true);
    d->leCondAction = d->optionsMenu->addAction(i18n("Less Than or Equals Condition"));
    d->leCondAction->setCheckable(true);
    d->optionsMenu->addSeparator();
    d->excludeUnrated = d->optionsMenu->addAction(i18n("Exclude Items Without Rating"));
    d->excludeUnrated->setCheckable(true);
    d->optionsBtn->setMenu(d->optionsMenu);

    layout()->setAlignment(d->ratingWidget, Qt::AlignVCenter|Qt::AlignRight);
    setMargin(0);
    setSpacing(0);

    connect(d->optionsMenu, SIGNAL(triggered(QAction*)),
            this, SLOT(slotOptionsTriggered(QAction*)));

    connect(d->optionsMenu, SIGNAL(aboutToShow()),
            this, SLOT(slotOptionsMenu()));

    connect(d->ratingWidget, SIGNAL(signalRatingFilterChanged(int,ImageFilterSettings::RatingCondition,bool)),
            this, SIGNAL(signalRatingFilterChanged(int,ImageFilterSettings::RatingCondition,bool)));
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:35,代码来源:ratingfilter.cpp

示例6: setFirstGid

void tmx::Tileset::init(pugi::xml_node tilesetNode) {
	setFirstGid(tilesetNode.attribute("firstgid").as_int());
	setSource(tilesetNode.attribute("source").as_string());
	setName(tilesetNode.attribute("name").as_string());
	setTileWidth(tilesetNode.attribute("tilewidth").as_uint());
	setTileHeight(tilesetNode.attribute("tileheight").as_uint());
	setSpacing(tilesetNode.attribute("spacing").as_uint());
	setMargin(tilesetNode.attribute("margin").as_uint());

	for(pugi::xml_node prop = tilesetNode.child("properties").first_child(); prop; prop = prop.next_sibling()) {
		mProperties.insert(std::pair<std::string, std::string>(prop.attribute("name").as_string(), prop.attribute("value").as_string()));
	}

	mTileOffset.init(tilesetNode.child("tileoffset"));

	mImage.init(tilesetNode.child("image"));

	mTerrainTypes.init(tilesetNode.child("terraintypes"));

	for(pugi::xml_node tile = tilesetNode.child("tile"); tile; tile = tile.next_sibling("tile")) {
		tmx::Tile tempTile;
		tempTile.setID(tile.attribute("id").as_uint());
		tempTile.setTerrain(tile.attribute("terrain").as_string());
		mTile.push_back(tempTile);
	}
}
开发者ID:Ceann,项目名称:tmx-core,代码行数:26,代码来源:TMX_Tileset.cpp

示例7: DMovie

QWidget* GeneratingView::createMainWidget()
{

    QLabel *label = new QLabel;
    label->setFixedSize(32,32);
    // FIXME: hidpi
    QString path = ":/resource/theme/images/spinner/32/";
    DMovie *movie = new DMovie(label);
    movie->setMoviePath(path, label);
    movie->start();

    DBaseButton *button = new DBaseButton(tr("Cancel"),this);
    button->setFixedSize(160, 36);
    connect(button, SIGNAL(clicked(bool)), this, SLOT(onCancelButtonClicked()));

    QWidget* mainWidget = new QWidget;

    InfoLabel* text = new InfoLabel;
    text->setText(tr("Generating verification code, please wait... "));

    auto mainLayout = new QVBoxLayout(mainWidget);
    mainLayout->setSpacing(0);
    mainLayout->setMargin(0);

    mainLayout->addSpacing(60);
    mainLayout->addWidget(label, 0, Qt::AlignHCenter);
    mainLayout->addSpacing(30);
    mainLayout->addWidget(text, 0, Qt::AlignHCenter);

    addButton(button);

    return mainWidget;
}
开发者ID:linuxdeepin,项目名称:deepin-remote-assistance,代码行数:33,代码来源:generatingview.cpp

示例8: PropertyWidget

KSimPackageFileWidget::KSimPackageFileWidget(QWidget *parent, const char *name )
	:	PropertyWidget(1, parent,name)
{
	setMargin(0);
	
	m_directories = new KSimDirectorySelector(this, "Package directories");
	m_directories->setTitle(i18n("Package directories:"));
	m_directories->setStartDir(QString::fromLatin1(":<KSimPackageFile>"));
	
	m_files = new KSimFileListSelector(this, "Package files");
	m_files->setTitle(i18n("Package files:"));
	m_files->setFilter(i18n("*.so|Package files (*.so)\n*|All files (*)"));
	m_files->setStartDir(QString::fromLatin1(":<KSimPackageFile>"));

	// Setup data
	
	KConfig * config = kapp->config();
	
	QString group(config->group());
	
	config->setGroup("Packages");
	
	QStringList dirList;
	
	m_dirList = config->readListEntry("Directories");
	m_fileList = config->readListEntry("Files");

	config->setGroup(group);
	
	m_directories->setFileList(m_dirList);
	m_files->setFileList(m_fileList);

}
开发者ID:BackupTheBerlios,项目名称:ksimus,代码行数:33,代码来源:ksimpackagefilewidget.cpp

示例9: switch

bool QLayout::qt_property( int id, int f, QVariant* v)
{
    switch ( id - staticMetaObject()->propertyOffset() ) {
    case 0: switch( f ) {
	case 0: setMargin(v->asInt()); break;
	case 1: *v = QVariant( this->margin() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 1: switch( f ) {
	case 0: setSpacing(v->asInt()); break;
	case 1: *v = QVariant( this->spacing() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 2: switch( f ) {
	case 0: setResizeMode((ResizeMode&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->resizeMode() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    default:
	return QObject::qt_property( id, f, v );
    }
    return TRUE;
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:26,代码来源:moc_qlayout.cpp

示例10: QLabel

DropArea::DropArea(QWidget *parent) : QLabel(parent) {
    setMargin(15);
    setAlignment(Qt::AlignCenter);
    setAcceptDrops(true);
    setAutoFillBackground(true);
    clear();
}
开发者ID:junwatu,项目名称:junwatunes,代码行数:7,代码来源:droparea.cpp

示例11: QWidget

void OperatorUi::setupPrimary()
{
	primary_ = new QWidget(this);


	auto primaryLayout = new QHBoxLayout(primary_);

	primaryLayout->setMargin(0);

	primaryLayout->setSpacing(0);

	primaryLayout->setContentsMargins(0,0,0,0);


	ModControl* level = new ModControl("LEVEL", 3, 3, primary_);

	primaryLayout->addWidget(level);


	ModControl* offset = new ModControl("OFFS", 3, 3, primary_);

	primaryLayout->addWidget(offset);


	ModControl* ratio = new ModControl("RATIO", 3, 3, primary_);

	primaryLayout->addWidget(ratio);


	layout_->addWidget(primary_);
}
开发者ID:eriser,项目名称:Anthem,代码行数:31,代码来源:OperatorUi.cpp

示例12: QDialog

CExportThemeDialog::CExportThemeDialog(QWidget *parent)
                  : QDialog(parent)
{
    auto mainLayout = new QVBoxLayout(this);
    auto page = new QWidget(this);
    auto layout = new QGridLayout(page);
    auto buttonBox = QtCurve::createDialogButtonBox(this);
    if (QWidget *win = window()) {
        win->setWindowTitle(i18n("Export Theme"));
    }
    layout->setSpacing(QApplication::style()
                       ->pixelMetric(QStyle::PM_DefaultLayoutSpacing));
    layout->setMargin(0);
    layout->addWidget(new QLabel(i18n("Name:"), page), 0, 0);
    layout->addWidget(new QLabel(i18n("Comment:"), page), 1, 0);
    layout->addWidget(new QLabel(i18n("Destination folder:"), page), 2, 0);
    layout->addWidget(themeName = new QLineEdit(page), 0, 1);
    layout->addWidget(themeComment = new QLineEdit(i18n("QtCurve based theme"),
                                                   page), 1, 1);
    layout->addWidget(themeUrl=new KUrlRequester(page), 2, 1);
    layout->addItem(new QSpacerItem(2, 2, QSizePolicy::Minimum,
                                    QSizePolicy::Expanding), 3, 1);

    themeUrl->setMode(KFile::Directory | KFile::ExistingOnly |
                      KFile::LocalOnly);
    themeUrl->lineEdit()->setReadOnly(true);
    themeUrl->setUrl(QDir::homePath());

    mainLayout->addWidget(page);
    mainLayout->addWidget(buttonBox);
}
开发者ID:KDE,项目名称:qtcurve,代码行数:31,代码来源:exportthemedialog.cpp

示例13: m_showLocals

LocalsAndInspectorWindow::LocalsAndInspectorWindow(QWidget *locals,
      QWidget *inspector, QWidget *returnWidget)
    : m_showLocals(false)
{
    auto layout = new QVBoxLayout(this);
    layout->setMargin(0);
    layout->setSpacing(0);

    auto splitter = new Core::MiniSplitter(Qt::Vertical);
    layout->addWidget(splitter);

    auto localsAndInspector = new QStackedWidget;
    localsAndInspector->addWidget(locals);
    localsAndInspector->addWidget(inspector);
    localsAndInspector->setCurrentWidget(inspector);

    splitter->addWidget(localsAndInspector);
    splitter->addWidget(returnWidget);

    splitter->setStretchFactor(0, 3);
    splitter->setStretchFactor(2, 1);
    splitter->setStretchFactor(3, 1);

    // Timer is to prevent flicker when switching between Inpector and Locals
    // when debugger engine changes states.
    m_timer.setSingleShot(true);
    m_timer.setInterval(500); // TODO: remove the magic number!
    connect(&m_timer, &QTimer::timeout, [this, localsAndInspector] {
        localsAndInspector->setCurrentIndex(m_showLocals ? LocalsIndex : InspectorIndex);
    });
}
开发者ID:choenig,项目名称:qt-creator,代码行数:31,代码来源:localsandexpressionswindow.cpp

示例14: QwtTextLabel

/*!
  \param parent Parent widget
*/
QwtLegendLabel::QwtLegendLabel( QWidget *parent ):
    QwtTextLabel( parent )
{
    d_data = new PrivateData;
    setMargin( Margin );
    setIndent( Margin );
}
开发者ID:iclosure,项目名称:jdataanalyse,代码行数:10,代码来源:qwt_legend_label.cpp

示例15: inSetGeometry

XKPPlacementLayout::XKPPlacementLayout(int spacing)
    : inSetGeometry(false)
{
    setMargin(0);
    setSpacing(spacing);
    setSizeType(PlacementSize);
}
开发者ID:gcubar,项目名称:XKP,代码行数:7,代码来源:xkpplacementlayout.cpp


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