本文整理汇总了C++中FlowLayout类的典型用法代码示例。如果您正苦于以下问题:C++ FlowLayout类的具体用法?C++ FlowLayout怎么用?C++ FlowLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FlowLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lua_FlowLayout_addRef
static int lua_FlowLayout_addRef(lua_State* state)
{
// Get the number of parameters.
int paramCount = lua_gettop(state);
// Attempt to match the parameters to a valid binding.
switch (paramCount)
{
case 1:
{
if ((lua_type(state, 1) == LUA_TUSERDATA))
{
FlowLayout* instance = getInstance(state);
instance->addRef();
return 0;
}
lua_pushstring(state, "lua_FlowLayout_addRef - Failed to match the given parameters to a valid function signature.");
lua_error(state);
break;
}
default:
{
lua_pushstring(state, "Invalid number of parameters (expected 1).");
lua_error(state);
break;
}
}
return 0;
}
示例2: QWidget
AddressRowWidget::AddressRowWidget(QWidget *parent, const QString &headerName,
const QList<Imap::Message::MailAddress> &addresses, MessageView *messageView):
QWidget(parent)
{
FlowLayout *lay = new FlowLayout(this, 0, 0, -1);
setLayout(lay);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
const QString &headerNameEscaped = Qt::escape(headerName);
#else
const QString &headerNameEscaped = headerName.toHtmlEscaped();
#endif
QLabel *title = new QLabel(QString::fromUtf8("<b>%1:</b>").arg(headerNameEscaped), this);
title->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
title->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
lay->addWidget(title);
for (int i = 0; i < addresses.size(); ++i) {
QWidget *w = new OneEnvelopeAddress(this, addresses[i], messageView,
i == addresses.size() - 1 ?
OneEnvelopeAddress::Position::Last :
OneEnvelopeAddress::Position::Middle);
lay->addWidget(w);
}
}
示例3: lua_FlowLayout_getHorizontalSpacing
static int lua_FlowLayout_getHorizontalSpacing(lua_State* state)
{
// Get the number of parameters.
int paramCount = lua_gettop(state);
// Attempt to match the parameters to a valid binding.
switch (paramCount)
{
case 1:
{
if ((lua_type(state, 1) == LUA_TUSERDATA))
{
FlowLayout* instance = getInstance(state);
int result = instance->getHorizontalSpacing();
// Push the return value onto the stack.
lua_pushinteger(state, result);
return 1;
}
lua_pushstring(state, "lua_FlowLayout_getHorizontalSpacing - Failed to match the given parameters to a valid function signature.");
lua_error(state);
break;
}
default:
{
lua_pushstring(state, "Invalid number of parameters (expected 1).");
lua_error(state);
break;
}
}
return 0;
}
示例4: QFrame
CaptureDialog::CaptureDialog(CaptureContext *ctx, OnCaptureMethod captureCallback,
OnInjectMethod injectCallback, QWidget *parent)
: QFrame(parent), ui(new Ui::CaptureDialog), m_Ctx(ctx)
{
ui->setupUi(this);
// setup FlowLayout for options group
{
QLayout *oldLayout = ui->optionsGroup->layout();
QObjectList options = ui->optionsGroup->children();
options.removeOne((QObject *)oldLayout);
delete oldLayout;
FlowLayout *optionsFlow = new FlowLayout(ui->optionsGroup, -1, 3, 3);
optionsFlow->setFixedGrid(true);
for(QObject *o : options)
optionsFlow->addWidget(qobject_cast<QWidget *>(o));
ui->optionsGroup->setLayout(optionsFlow);
}
ui->envVar->setEnabled(false);
m_ProcessModel = new QStandardItemModel(0, 3, this);
m_ProcessModel->setHeaderData(0, Qt::Horizontal, tr("Name"));
m_ProcessModel->setHeaderData(1, Qt::Horizontal, tr("PID"));
m_ProcessModel->setHeaderData(2, Qt::Horizontal, tr("Window Title"));
QSortFilterProxyModel *proxy = new QSortFilterProxyModel(this);
proxy->setSourceModel(m_ProcessModel);
// filter on all columns
proxy->setFilterKeyColumn(-1);
// allow updating the underlying model
proxy->setDynamicSortFilter(true);
ui->processList->setModel(proxy);
ui->processList->setAlternatingRowColors(true);
// sort by PID by default
ui->processList->sortByColumn(1, Qt::AscendingOrder);
// TODO Vulkan Layer
ui->vulkanLayerWarn->setVisible(false);
m_CaptureCallback = captureCallback;
m_InjectCallback = injectCallback;
setSettings(CaptureSettings());
updateGlobalHook();
}
示例5: execSyncV
void FlowLayoutBase::execSyncV( FieldContainer &oFrom,
ConstFieldMaskArg whichField,
AspectOffsetStore &oOffsets,
ConstFieldMaskArg syncMode,
const UInt32 uiSyncInfo)
{
FlowLayout *pThis = static_cast<FlowLayout *>(this);
pThis->execSync(static_cast<FlowLayout *>(&oFrom),
whichField,
oOffsets,
syncMode,
uiSyncInfo);
}
示例6: widthForHeight
int FlowLayout::widthForHeight( int h ) const
{
if ( _cachedH != h )
{
//Not all C++ compilers support "mutable" yet:
FlowLayout * mthis = (FlowLayout*)this;
int w = mthis->doLayout( QRect(0,0,0,h), true );
mthis->_cachedH = h;
mthis->_cachedW = w;
return w;
}
return _cachedW;
}
示例7: heightForWidth
int FlowLayout::heightForWidth( int w ) const
{
if ( _cachedW != w )
{
//Not all C++ compilers support "mutable" yet:
FlowLayout * mthis = (FlowLayout*)this;
int h = mthis->doLayout( QRect(0,0,w,0), true );
mthis->_cachedH = h;
mthis->_cachedW = w;
return h;
}
return _cachedH;
}
示例8: FlowLayout
void StartDlg::init(QStringList partsName)
{
FlowLayout *layout = new FlowLayout(ui->groupBox);
for(int i=0;i<partsName.count();i++)
{
QCheckBox *check = new QCheckBox(partsName.at(i),ui->groupBox);
check->setChecked(true);
check->setMinimumSize(QSize(100, check->height()));
layout->addWidget(check);
checkList.append(check);
}
adjustSize();
ui->groupBox->setLayout(layout);
}
示例9: QWidget
QWidget *TilesetItemBox::makeCategory(const QString &categoryItem)
{
QTabWidget *TileSetsCategories = ui->TileSetsCategories;
QWidget *catWid;
QWidget *scrollWid;
QGridLayout *catLayout;
QLabel *grpLabel;
QComboBox *tilesetGroup;
QSpacerItem *spItem;
QScrollArea *TileSets;
FlowLayout *theLayOut;
catWid = new QWidget();
scrollWid = new QWidget();
catLayout = new QGridLayout(catWid);
catLayout->setSpacing(0);
catLayout->setContentsMargins(0, 0, 0, 0);
grpLabel = new QLabel(catWid);
grpLabel->setText(tr("Group:"));
catLayout->addWidget(grpLabel, 0, 0, 1, 1);
tilesetGroup = new QComboBox(catWid);
catLayout->addWidget(tilesetGroup, 0, 1, 1, 1);
tilesetGroup->setInsertPolicy(QComboBox::InsertAlphabetically);
spItem = new QSpacerItem(1283, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
catLayout->addItem(spItem, 0, 2, 1, 1);
TileSets = new QScrollArea(catWid);
TileSets->setWidget(scrollWid);
TileSets->setWidgetResizable(true);
TileSets->setFrameShape(QFrame::StyledPanel);
TileSets->setFrameShadow(QFrame::Raised);
TileSets->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
TileSets->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
theLayOut = new FlowLayout(scrollWid);
theLayOut->setSizeConstraint(QLayout::SetNoConstraint);
catLayout->addWidget(TileSets, 1, 0, 1, 3);
TileSetsCategories->addTab(catWid, QString());
TileSetsCategories->setTabText(TileSetsCategories->indexOf(catWid), categoryItem);
return catWid;
}
示例10: QGraphicsWidget
Window::Window()
: QGraphicsWidget(0, Qt::Window)
{
FlowLayout *lay = new FlowLayout;
QLatin1String wiseWords("I am not bothered by the fact that I am unknown."
" I am bothered when I do not know others. (Confucius)");
QString sentence(wiseWords);
QStringList words = sentence.split(QLatin1Char(' '), QString::SkipEmptyParts);
for (int i = 0; i < words.count(); ++i) {
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
QLabel *label = new QLabel(words.at(i));
label->setFrameStyle(QFrame::Box | QFrame::Plain);
proxy->setWidget(label);
lay->addItem(proxy);
}
setLayout(lay);
}
示例11: QDialog
RemoteManager::RemoteManager(ICaptureContext &ctx, MainWindow *main)
: QDialog(NULL), ui(new Ui::RemoteManager), m_Ctx(ctx), m_Main(main)
{
ui->setupUi(this);
m_ExternalRef.release(1);
ui->hosts->setFont(Formatter::PreferredFont());
ui->hostname->setFont(Formatter::PreferredFont());
ui->runCommand->setFont(Formatter::PreferredFont());
ui->hosts->setColumns({tr("Hostname"), tr("Running")});
ui->hosts->header()->setSectionResizeMode(0, QHeaderView::Stretch);
ui->hosts->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
lookupsProgressFlow = new QWidget(this);
FlowLayout *flow = new FlowLayout(lookupsProgressFlow, 0, 3, 3);
lookupsProgressFlow->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
flow->addWidget(ui->progressIcon);
flow->addWidget(ui->progressText);
flow->addWidget(ui->progressCount);
QVBoxLayout *vertical = new QVBoxLayout(this);
vertical->addWidget(ui->hosts);
vertical->addWidget(lookupsProgressFlow);
vertical->addWidget(ui->bottomLayout->parentWidget());
m_Ctx.Config().AddAndroidHosts();
for(RemoteHost *h : m_Ctx.Config().RemoteHosts)
addHost(h);
on_hosts_itemSelectionChanged();
}
示例12: QGraphicsWidget
KGVisualItemGroup::KGVisualItemGroup(QGraphicsWidget *parent) :
QGraphicsWidget(parent, Qt::Widget), m_isFiltered(0)
{
FlowLayout *layout = new FlowLayout;
layout->setSpacing(Qt::Horizontal, 40);
layout->setSpacing(Qt::Vertical, 40);
layout->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
layout->setContentsMargins(40,40,20,10);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
setLayout(layout);
KGVisualAppendItem *appendItem = new KGVisualAppendItem(KGVisualAppendItem::APPEND, this);
appendItem->setPreferredSize(225, 155);
layout->addItem(appendItem);
p_visualInsertItem = new KGVisualAppendItem(KGVisualAppendItem::INSERT, this);
p_visualInsertItem->setPreferredSize(40, 155);
p_visualInsertItem->setVisible(false);
setAcceptHoverEvents(true);
setAcceptDrops(false);
QGraphicsProxyWidget *w = createButton();
w->setPos(0, 40);
w->setParentItem(this);
//setFlags(QGraphicsItem::ItemHasNoContents);
}
示例13: lua_FlowLayout_setSpacing
static int lua_FlowLayout_setSpacing(lua_State* state)
{
// Get the number of parameters.
int paramCount = lua_gettop(state);
// Attempt to match the parameters to a valid binding.
switch (paramCount)
{
case 3:
{
if ((lua_type(state, 1) == LUA_TUSERDATA) &&
lua_type(state, 2) == LUA_TNUMBER &&
lua_type(state, 3) == LUA_TNUMBER)
{
// Get parameter 1 off the stack.
int param1 = (int)luaL_checkint(state, 2);
// Get parameter 2 off the stack.
int param2 = (int)luaL_checkint(state, 3);
FlowLayout* instance = getInstance(state);
instance->setSpacing(param1, param2);
return 0;
}
lua_pushstring(state, "lua_FlowLayout_setSpacing - Failed to match the given parameters to a valid function signature.");
lua_error(state);
break;
}
default:
{
lua_pushstring(state, "Invalid number of parameters (expected 3).");
lua_error(state);
break;
}
}
return 0;
}
示例14: QWidget
Window::Window(QWidget *parent) : QWidget(parent) {
FlowLayout *flowLayout = new FlowLayout;
flowLayout->addWidget(new QPushButton(tr("Short")));
flowLayout->addWidget(new QPushButton(tr("Longer")));
flowLayout->addWidget(new QPushButton(tr("Different text")));
flowLayout->addWidget(new QPushButton(tr("More text")));
flowLayout->addWidget(new QPushButton(tr("Even longer button text")));
setLayout(flowLayout);
setWindowTitle(tr("balabal"));
}
示例15: tr
void ToolBoxWidget::initUI()
{
#ifdef __APPLE__
// Only Mac needs this. ToolButton is naturally borderless on Win/Linux.
QString sStyle =
"QToolButton { border: 0px; }"
"QToolButton:pressed { border: 1px solid #ADADAD; border-radius: 2px; background-color: #D5D5D5; }"
"QToolButton:checked { border: 1px solid #ADADAD; border-radius: 2px; background-color: #D5D5D5; }";
ui->pencilButton->setStyleSheet(sStyle);
ui->selectButton->setStyleSheet(sStyle);
ui->moveButton->setStyleSheet(sStyle);
ui->handButton->setStyleSheet(sStyle);
ui->penButton->setStyleSheet(sStyle);
ui->eraserButton->setStyleSheet(sStyle);
ui->polylineButton->setStyleSheet(sStyle);
ui->bucketButton->setStyleSheet(sStyle);
ui->brushButton->setStyleSheet(sStyle);
ui->eyedropperButton->setStyleSheet(sStyle);
ui->clearButton->setStyleSheet(sStyle);
ui->smudgeButton->setStyleSheet(sStyle);
#endif
ui->pencilButton->setToolTip( tr( "Pencil Tool (%1): Sketch with pencil" )
.arg( GetToolTips( CMD_TOOL_PENCIL ) ) );
ui->selectButton->setToolTip( tr( "Select Tool (%1): Select an object" )
.arg( GetToolTips( CMD_TOOL_SELECT ) ) );
ui->moveButton->setToolTip( tr( "Move Tool (%1): Move an object" )
.arg( GetToolTips( CMD_TOOL_MOVE ) ) );
ui->handButton->setToolTip( tr( "Hand Tool (%1): Move the canvas" )
.arg( GetToolTips( CMD_TOOL_HAND ) ) );
ui->penButton->setToolTip( tr( "Pen Tool (%1): Sketch with pen" )
.arg( GetToolTips( CMD_TOOL_PEN ) ) );
ui->eraserButton->setToolTip( tr( "Eraser Tool (%1): Erase" )
.arg( GetToolTips( CMD_TOOL_ERASER ) ) );
ui->polylineButton->setToolTip( tr( "Polyline Tool (%1): Create line/curves" )
.arg( GetToolTips( CMD_TOOL_POLYLINE ) ) );
ui->bucketButton->setToolTip( tr( "Paint Bucket Tool (%1): Fill selected area with a color" )
.arg( GetToolTips( CMD_TOOL_BUCKET ) ) );
ui->brushButton->setToolTip( tr( "Brush Tool (%1): Paint smooth stroke with a brush" )
.arg( GetToolTips( CMD_TOOL_BRUSH ) ) );
ui->eyedropperButton->setToolTip( tr( "Eyedropper Tool (%1): "
"Set color from the stage<br>[ALT] for instant access" )
.arg( GetToolTips( CMD_TOOL_EYEDROPPER ) ) );
ui->clearButton->setToolTip( tr( "Clear Frame (%1): Erases content of selected frame" )
.arg( GetToolTips( CMD_CLEAR_FRAME ) ) );
ui->smudgeButton->setToolTip( tr( "Smudge Tool (%1):<br>Edit polyline/curves<br>"
"Liquify bitmap pixels<br> (%1)+[Alt]: Smooth" )
.arg( GetToolTips( CMD_TOOL_SMUDGE ) ) );
ui->pencilButton->setWhatsThis( tr( "Pencil Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_PENCIL ) ) );
ui->selectButton->setWhatsThis( tr( "Select Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_SELECT ) ) );
ui->moveButton->setWhatsThis( tr( "Move Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_MOVE ) ) );
ui->handButton->setWhatsThis( tr( "Hand Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_HAND ) ) );
ui->penButton->setWhatsThis( tr( "Pen Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_PEN ) ) );
ui->eraserButton->setWhatsThis( tr( "Eraser Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_ERASER ) ) );
ui->polylineButton->setWhatsThis( tr( "Polyline Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_POLYLINE ) ) );
ui->bucketButton->setWhatsThis( tr( "Paint Bucket Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_BUCKET ) ) );
ui->brushButton->setWhatsThis( tr( "Brush Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_BRUSH ) ) );
ui->eyedropperButton->setWhatsThis( tr( "Eyedropper Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_EYEDROPPER ) ) );
ui->clearButton->setWhatsThis( tr( "Clear Tool (%1)" )
.arg( GetToolTips( CMD_CLEAR_FRAME ) ) );
ui->smudgeButton->setWhatsThis( tr( "Smudge Tool (%1)" )
.arg( GetToolTips( CMD_TOOL_SMUDGE ) ) );
connect(ui->clearButton, &QToolButton::clicked, this, &ToolBoxWidget::clearButtonClicked);
connect(ui->pencilButton, &QToolButton::clicked, this, &ToolBoxWidget::pencilOn);
connect(ui->eraserButton, &QToolButton::clicked, this, &ToolBoxWidget::eraserOn);
connect(ui->selectButton, &QToolButton::clicked, this, &ToolBoxWidget::selectOn);
connect(ui->moveButton, &QToolButton::clicked, this, &ToolBoxWidget::moveOn);
connect(ui->penButton, &QToolButton::clicked, this, &ToolBoxWidget::penOn);
connect(ui->handButton, &QToolButton::clicked, this, &ToolBoxWidget::handOn);
connect(ui->polylineButton, &QToolButton::clicked, this, &ToolBoxWidget::polylineOn);
connect(ui->bucketButton, &QToolButton::clicked, this, &ToolBoxWidget::bucketOn);
connect(ui->eyedropperButton, &QToolButton::clicked, this, &ToolBoxWidget::eyedropperOn);
connect(ui->brushButton, &QToolButton::clicked, this, &ToolBoxWidget::brushOn);
connect(ui->smudgeButton, &QToolButton::clicked, this, &ToolBoxWidget::smudgeOn);
delete ui->toolGroup->layout();
FlowLayout* flowlayout = new FlowLayout;
flowlayout->addWidget(ui->clearButton);
flowlayout->addWidget(ui->pencilButton);
flowlayout->addWidget(ui->eraserButton);
flowlayout->addWidget(ui->selectButton);
flowlayout->addWidget(ui->moveButton);
flowlayout->addWidget(ui->penButton);
flowlayout->addWidget(ui->handButton);
flowlayout->addWidget(ui->polylineButton);
flowlayout->addWidget(ui->bucketButton);
flowlayout->addWidget(ui->eyedropperButton);
//.........这里部分代码省略.........