本文整理汇总了C++中setSpacing函数的典型用法代码示例。如果您正苦于以下问题:C++ setSpacing函数的具体用法?C++ setSpacing怎么用?C++ setSpacing使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setSpacing函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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))
);
}
示例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.") );
}
示例3: ChatWindow
UrlCatcher::UrlCatcher(QWidget* parent) : ChatWindow(parent)
{
setName(i18n("URL Catcher"));
setType(ChatWindow::UrlCatcher);
setSpacing(0);
setupActions();
setupUrlTree();
}
示例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
}
示例5: setLayoutType
void HGLayout::setWidget(HGWidget* widget)
{
//qDebug("HGLayout::setWidget");
mWidget = widget;
//todo create layout object
setLayoutType(mLayoutType);
setMargins(mMargins);
setSpacing(mSpacing);
}
示例6: QListWidget
PiecesList::PiecesList(QWidget *parent)
: QListWidget(parent)
{
setDragEnabled(true);
setViewMode(QListView::IconMode);
setIconSize(QSize(60, 60));
setSpacing(10);
setAcceptDrops(true);
setDropIndicatorShown(true);
}
示例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();
}
示例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);
}
示例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()));
}
示例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);
}
示例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);
}
示例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);
}
示例13: setSpacing
void CameraLayout::reset(){
setSpacing( 2 );
setMargin( 1 );
clear();
calculateCellsSize();
checkLayoutDimensions();
fill();
d->rowCount = 0;
d->columnCount = 0;
d->hasSpace = true;
}
示例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>());
}
}
示例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);
}
}