• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setSpacing函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: QDialog

IconPickerDialog::IconPickerDialog(QWidget *parent) :
	QDialog(parent),
	ui(new Ui::IconPickerDialog)
{
    MultiMCPlatform::fixWM_CLASS(this);
	ui->setupUi(this);
	setWindowModality(Qt::WindowModal);
	
	auto contentsWidget = ui->iconView;
	contentsWidget->setViewMode(QListView::IconMode);
	contentsWidget->setFlow(QListView::LeftToRight);
	contentsWidget->setIconSize(QSize(48, 48));
	contentsWidget->setMovement(QListView::Static);
	contentsWidget->setResizeMode(QListView::Adjust);
	contentsWidget->setSelectionMode(QAbstractItemView::SingleSelection);
	contentsWidget->setSpacing(5);
	contentsWidget->setWordWrap(false);
	contentsWidget->setWrapping(true);
	contentsWidget->setUniformItemSizes(true);
	contentsWidget->setTextElideMode(Qt::ElideRight);
	contentsWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
	contentsWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
	contentsWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	contentsWidget->setItemDelegate(new ListViewDelegate());
	
	//contentsWidget->setAcceptDrops(true);
	contentsWidget->setDropIndicatorShown(true);
	contentsWidget->viewport()->setAcceptDrops(true);
	contentsWidget->setDragDropMode(QAbstractItemView::DropOnly);
	contentsWidget->setDefaultDropAction(Qt::CopyAction);
	
	contentsWidget->installEventFilter(this);
	
	contentsWidget->setModel(MMC->icons().get());
	
	auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"),QDialogButtonBox::ResetRole);
	auto buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"),QDialogButtonBox::ResetRole);
	
	
	connect(buttonAdd,SIGNAL(clicked(bool)),SLOT(addNewIcon()));
	connect(buttonRemove,SIGNAL(clicked(bool)),SLOT(removeSelectedIcon()));
	
	connect
	(
		contentsWidget,
		SIGNAL(doubleClicked(QModelIndex)),
		SLOT(activated(QModelIndex))
	);
	
	connect
	(
		contentsWidget->selectionModel(),
		SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
		SLOT(selectionChanged(QItemSelection,QItemSelection))
	);
}
开发者ID:Loras,项目名称:MultiMC5,代码行数:56,代码来源:IconPickerDialog.cpp


示例2: TQVBox

//BEGIN KMimeTypeChooser
KMimeTypeChooser::KMimeTypeChooser( const TQString &text,
                              const TQStringList &selMimeTypes,
                              const TQString &defaultGroup,
                              const TQStringList &groupsToShow,
                              int visuals,
                              TQWidget *parent,
                              const char *name )
    : TQVBox( parent, name )
{
  d = new KMimeTypeChooserPrivate();
  d->lvMimeTypes = 0;
  d->btnEditMimeType = 0;
  d->defaultgroup = defaultGroup;
  d->groups = groupsToShow;
  d->visuals = visuals;

  setSpacing( KDialogBase::spacingHint() );

  if ( !text.isEmpty() )
  {
    new TQLabel( text, this );
  }

  d->lvMimeTypes = new TDEListView( this );

  d->lvMimeTypes->addColumn( i18n("Mime Type") );
//   d->lvMimeTypes->setColumnWidthMode( 0, TQListView::Manual );

  if ( visuals & Comments )
  {
    d->lvMimeTypes->addColumn( i18n("Comment") );
    d->lvMimeTypes->setColumnWidthMode( 1, TQListView::Manual );
  }
  if ( visuals & Patterns )
    d->lvMimeTypes->addColumn( i18n("Patterns") );

  d->lvMimeTypes->setRootIsDecorated( true );

  loadMimeTypes( selMimeTypes );

  if (visuals & KMimeTypeChooser::EditButton)
  {
    TQHBox *btns = new TQHBox( this );
    ((TQBoxLayout*)btns->layout())->addStretch(1);
    d->btnEditMimeType = new TQPushButton( i18n("&Edit..."), btns );

    connect( d->btnEditMimeType, TQT_SIGNAL(clicked()), this, TQT_SLOT(editMimeType()) );
    d->btnEditMimeType->setEnabled( false );
    connect( d->lvMimeTypes, TQT_SIGNAL( doubleClicked ( TQListViewItem * )),
             this, TQT_SLOT( editMimeType()));
    connect( d->lvMimeTypes, TQT_SIGNAL(currentChanged(TQListViewItem*)),
             this, TQT_SLOT(slotCurrentChanged(TQListViewItem*)) );

    TQWhatsThis::add( d->btnEditMimeType, i18n(
        "Click this button to display the familiar TDE mime type editor.") );
  }
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:57,代码来源:kmimetypechooser.cpp


示例3: ChatWindow

UrlCatcher::UrlCatcher(QWidget* parent) : ChatWindow(parent)
{
    setName(i18n("URL Catcher"));
    setType(ChatWindow::UrlCatcher);

    setSpacing(0);

    setupActions();
    setupUrlTree();
}
开发者ID:KDE,项目名称:konversation,代码行数:10,代码来源:urlcatcher.cpp


示例4: DistroChartItem

    DistroChartItem():
        QwtPlotBarChart( "Page Hits" )
    {
        setLegendMode( QwtPlotBarChart::LegendBarTitles );
        setLegendIconSize( QSize( 10, 14 ) );
        setLayoutPolicy( AutoAdjustSamples );
        setLayoutHint( 4.0 ); // minimum width for a single bar

        setSpacing( 10 ); // spacing between bars
    }
开发者ID:Au-Zone,项目名称:qwt,代码行数:10,代码来源:barchart.cpp


示例5: setLayoutType

void HGLayout::setWidget(HGWidget* widget)
{
    //qDebug("HGLayout::setWidget");
    mWidget = widget;

    //todo create layout object
    setLayoutType(mLayoutType);
    setMargins(mMargins);
    setSpacing(mSpacing);
}
开发者ID:huqiuyun,项目名称:qt.project,代码行数:10,代码来源:hglayout.cpp


示例6: QListWidget

PiecesList::PiecesList(QWidget *parent)
    : QListWidget(parent)
{
    setDragEnabled(true);
    setViewMode(QListView::IconMode);
    setIconSize(QSize(60, 60));
    setSpacing(10);
    setAcceptDrops(true);
    setDropIndicatorShown(true);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:10,代码来源:pieceslist.cpp


示例7: setSpacing

void KNMusicHeaderLyrics::loadConfigure()
{
    //Update the spacing.
    setSpacing(m_musicConfigure->getData("LyricsTextSpacing",
                                         spacing()).toInt());
    //Update the font.
    setFont(m_musicConfigure->getData("LyricsFont", font()).value<QFont>());
    //Update the lyrics.
    update();
}
开发者ID:loki1412,项目名称:Mu,代码行数:10,代码来源:knmusicheaderlyrics.cpp


示例8: QListWidget

PiecesList::PiecesList(int pieceSize, QWidget *parent)
    : QListWidget(parent), m_PieceSize(pieceSize)
{
    setDragEnabled(true);
    setViewMode(QListView::IconMode);
    setIconSize(QSize(m_PieceSize, m_PieceSize));
    setSpacing(10);
    setAcceptDrops(true);
    setDropIndicatorShown(true);
}
开发者ID:ismaell,项目名称:android-qt5-qtbase,代码行数:10,代码来源:pieceslist.cpp


示例9: QGridLayout

QuickLaunchLayout::QuickLaunchLayout(QWidget * parent, RazorPanel *panel)
    : QGridLayout(parent),
      m_panel(panel)
{
    setSpacing(0);
    setContentsMargins(0, 0, 0, 0);

    connect(m_panel, SIGNAL(panelRealigned()),
            this, SLOT(relayout()));
}
开发者ID:Boris-de,项目名称:razor-qt,代码行数:10,代码来源:quicklaunchlayout.cpp


示例10: direction

/*!
    Constructs a new QBoxLayout with direction \a dir and main widget \a
    parent. \a parent may not be 0.

    The \a margin is the number of pixels between the edge of the
    widget and its managed children. The \a spacing is the default
    number of pixels between neighboring children. If \a spacing is -1
    the value of \a margin is used for \a spacing.

    \a name is the internal object name.

    \sa direction()
*/
QBoxLayout::QBoxLayout(QWidget *parent, Direction dir,
                        int margin, int spacing, const char *name)
    : QLayout(*new QBoxLayoutPrivate, 0, parent)
{
    Q_D(QBoxLayout);
    d->dir = dir;
    setMargin(margin);
    setObjectName(QString::fromAscii(name));
    setSpacing(spacing<0 ? margin : spacing);
}
开发者ID:Marforius,项目名称:qt,代码行数:23,代码来源:qboxlayout.cpp


示例11: QWidget

LibraryTabWidget::LibraryTabWidget(QWidget * parent)
  : QWidget(parent)
{
  auto mainLayout = new QVBoxLayout();

  mainLayout->setSpacing(0);

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

  setLayout(mainLayout);

  m_tabBar = new QWidget(this);

  m_tabBar->setFixedHeight(29);

  m_tabBar->setObjectName("VBlueGradientWidget");

  m_tabBar->setContentsMargins(0,0,5,0);

  m_removeButton = new QPushButton(this);

  QString str;
  str.append("QWidget { ");
  str.append("border: none;");
  str.append(" background-image: url(\":/images/delete.png\")");
  str.append("}");

  m_removeButton->setFlat(true);
  m_removeButton->setStyleSheet(str);
  m_removeButton->setFixedSize(20, 20);
  m_removeButton->setToolTip("Remove object");

  // Default to hide
  m_removeButton->hide();

  auto isConnected = connect(m_removeButton, SIGNAL(clicked(bool)), this, SIGNAL(removeButtonClicked(bool)));
  OS_ASSERT(isConnected);
 
  auto hLayout = new QHBoxLayout();
  hLayout->setContentsMargins(0, 0, 0, 0);
  hLayout->addStretch();
  hLayout->addWidget(m_removeButton, 0, Qt::AlignVCenter);

  m_tabBar->setLayout(hLayout);

  layout()->addWidget(m_tabBar);

  m_pageStack = new QStackedWidget();

  m_pageStack->setStyleSheet("QStackedWidget { border: none;}");

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

  layout()->addWidget(m_pageStack);
}
开发者ID:urbanengr,项目名称:OpenStudio,代码行数:55,代码来源:LibraryTabWidget.cpp


示例12: QWidget

void WindowMaterialDaylightRedirectionDeviceInspectorView::createLayout()
{
  auto hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  auto visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  auto mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit2();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // Daylight Redirection Device Type

  label = new QLabel("Daylight Redirection Device Type: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_daylightRedirectionDeviceType = new OSComboBox2();
  mainGridLayout->addWidget(m_daylightRedirectionDeviceType, row, 0, 1, 3);

  ++row;

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:55,代码来源:WindowMaterialDaylightRedirectionDeviceInspectorView.cpp


示例13: setSpacing

void CameraLayout::reset(){
    setSpacing( 2 );
    setMargin( 1 );
    clear();
    calculateCellsSize();
    checkLayoutDimensions();
    fill();
    d->rowCount = 0;
    d->columnCount = 0;
    d->hasSpace = true;
}
开发者ID:Sheridan,项目名称:ZoneMinder-Viewer,代码行数:11,代码来源:cameralayout.cpp


示例14: setSpacing

void UIBoxLayout::applyStyle(const OTMLNodePtr& styleNode)
{
    UILayout::applyStyle(styleNode);

    for(const OTMLNodePtr& node : styleNode->children()) {
        if(node->tag() == "spacing")
            setSpacing(node->value<int>());
        else if(node->tag() == "fit-children")
            setFitChildren(node->value<bool>());
    }
}
开发者ID:Xenioz,项目名称:otclient,代码行数:11,代码来源:uiboxlayout.cpp


示例15: spacing

/*!
    Constructs a new vertical box called name \a name and adds it to
    \a parentLayout.

    The \a spacing is the default number of pixels between neighboring
    children. If \a spacing is -1, this QVBoxLayout will inherit its
    parent's spacing().
*/
QVBoxLayout::QVBoxLayout(QLayout *parentLayout, int spacing,
                          const char *name)
    : QBoxLayout(TopToBottom)
{
    setSpacing(spacing);
    setObjectName(QString::fromAscii(name));
    if (parentLayout) {
        setParent(parentLayout);
        parentLayout->addItem(this);
    }
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:19,代码来源:qboxlayout.cpp


示例16: YearScaleDraw

    YearScaleDraw()
    {
        setTickLength( QwtScaleDiv::MajorTick, 0 );
        setTickLength( QwtScaleDiv::MinorTick, 0 );
        setTickLength( QwtScaleDiv::MediumTick, 6 );

        setLabelRotation( -60.0 );
        setLabelAlignment( Qt::AlignLeft | Qt::AlignVCenter );

        setSpacing( 15 );
    }
开发者ID:BryanF1947,项目名称:GoldenCheetah,代码行数:11,代码来源:plot.cpp


示例17: ViewSettingsPageBase

ColumnViewSettingsPage::ColumnViewSettingsPage(QWidget* parent) :
    ViewSettingsPageBase(parent),
    m_iconSizeGroupBox(0),
    m_fontRequester(0),
    m_textWidthBox(0)
{
    const int spacing = KDialog::spacingHint();
    const int margin = KDialog::marginHint();
    const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);

    setSpacing(spacing);
    setMargin(margin);

    // Create "Icon" properties
    m_iconSizeGroupBox = new IconSizeGroupBox(this);
    m_iconSizeGroupBox->setSizePolicy(sizePolicy);

    const int min = ZoomLevelInfo::minimumLevel();
    const int max = ZoomLevelInfo::maximumLevel();
    m_iconSizeGroupBox->setDefaultSizeRange(min, max);
    m_iconSizeGroupBox->setPreviewSizeRange(min, max);

    // create "Text" properties
    QGroupBox* textGroup = new QGroupBox(i18nc("@title:group", "Text"), this);
    textGroup->setSizePolicy(sizePolicy);

    QLabel* fontLabel = new QLabel(i18nc("@label:listbox", "Font:"), textGroup);
    m_fontRequester = new DolphinFontRequester(textGroup);

    QLabel* textWidthLabel = new QLabel(i18nc("@label:listbox", "Text width:"), textGroup);
    m_textWidthBox = new KComboBox(textGroup);
    m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Small"));
    m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Medium"));
    m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Large"));
    m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Huge"));

    QGridLayout* textGroupLayout = new QGridLayout(textGroup);
    textGroupLayout->addWidget(fontLabel, 0, 0, Qt::AlignRight);
    textGroupLayout->addWidget(m_fontRequester, 0, 1);
    textGroupLayout->addWidget(textWidthLabel, 1, 0, Qt::AlignRight);
    textGroupLayout->addWidget(m_textWidthBox, 1, 1);

    // Add a dummy widget with no restriction regarding
    // a vertical resizing. This assures that the dialog layout
    // is not stretched vertically.
    new QWidget(this);

    loadSettings();

    connect(m_iconSizeGroupBox, SIGNAL(defaultSizeChanged(int)), this, SIGNAL(changed()));
    connect(m_iconSizeGroupBox, SIGNAL(previewSizeChanged(int)), this, SIGNAL(changed()));
    connect(m_fontRequester, SIGNAL(changed()), this, SIGNAL(changed()));
    connect(m_textWidthBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed()));
}
开发者ID:vishesh,项目名称:kde-baseapps,代码行数:54,代码来源:columnviewsettingspage.cpp


示例18: switch

void Smb4KSharesView::setViewMode(QListView::ViewMode mode, int iconSize)
{
  //
  // Set the view mode
  //
  QListWidget::setViewMode(mode);
  
  //
  // Make adjustments
  //
  switch(mode)
  {
    case IconMode:
    {
      setUniformItemSizes(true);
      setIconSize(QSize(iconSize, iconSize));
      setSpacing(5);
      break;
    }
    case ListMode:
    {
      setUniformItemSizes(false);
      setIconSize(QSize(iconSize, iconSize));
      setSpacing(0);
      break;
    }
    default:
    {
      break;
    }
  }
  
  //
  // Align the items 
  //
  for (int i = 0; i < count(); ++i)
  {
    Smb4KSharesViewItem *viewItem = static_cast<Smb4KSharesViewItem *>(item(i));
    viewItem->setItemAlignment(mode);
  }
}
开发者ID:KDE,项目名称:smb4k,代码行数:41,代码来源:smb4ksharesview.cpp


示例19: QHBoxLayout

void PageNavigator::createLayout()
{
    auto layout = new QHBoxLayout();
    layout->setContentsMargins(0,0,0,0);
    layout->setSpacing(2);

    setLayout(layout);

    m_buttonGroup = new QButtonGroup(this);
    connect(m_buttonGroup, static_cast<void (QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), this, &PageNavigator::on_buttonClicked);

    QPushButton * button = nullptr;

    ///! button first page
    button = new QPushButton(this);
    button->setIcon(QIcon(":/shared_gui_components/images/fast_reverse.png"));
    button->setFixedSize(40,20);
    button->setCheckable(false);
    connect(button, &QPushButton::clicked, this, &PageNavigator::on_firstPage);
    layout->addWidget(button);

    ///! button previous page
    button = new QPushButton(this);
    button->setIcon(QIcon(":/shared_gui_components/images/reverse.png"));
    button->setFixedSize(40,20);
    button->setCheckable(false);
    connect(button, &QPushButton::clicked, this, &PageNavigator::on_previousPage);
    layout->addWidget(button);

    ///! buttons for pages listed
    m_buttonLayout = new QHBoxLayout();
    m_buttonLayout->setContentsMargins(0,0,0,0);
    m_buttonLayout->setSpacing(2);
    layout->addLayout(m_buttonLayout);
    makeNumberedButtons();

    ///! button next page
    button = new QPushButton(this);
    button->setIcon(QIcon(":/shared_gui_components/images/forward.png"));
    button->setFixedSize(40,20);
    button->setCheckable(false);
    connect(button, &QPushButton::clicked, this, &PageNavigator::on_nextPage);
    layout->addWidget(button);

    ///! button last page
    button = new QPushButton(this);
    button->setIcon(QIcon(":/shared_gui_components/images/fast_forward.png"));
    button->setFixedSize(40,20);
    button->setCheckable(false);
    connect(button, &QPushButton::clicked, this, &PageNavigator::on_lastPage);
    layout->addWidget(button);

}
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:53,代码来源:PageNavigator.cpp


示例20: QWidget

PlanarSurfaceWidget::PlanarSurfaceWidget(bool isIP, QWidget * parent )
  : QWidget(parent)
{
  this->setObjectName("GrayWidget");

  setUnits(isIP);

  auto layout = new QGridLayout();
  layout->setContentsMargins(7,7,7,7);
  layout->setSpacing(7);
  this->setLayout(layout);
}
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:12,代码来源:PlanarSurfaceWidget.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setSpeed函数代码示例发布时间:2022-05-30
下一篇:
C++ setSourceModel函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap