In questa pagina

Layouting::Layout Class

class Layouting::Layout

Classe base per le classi di creazione dei layout. Altro...

Header: #include <Layout>
Inherits: Layouting::Object
Inherited By:

Layouting::Column, Layouting::Flow, Layouting::Form, Layouting::Grid, and Layouting::Row

Funzioni pubbliche

void addItem(Layouting::Layout::I item)
void addItems(std::initializer_list<Layouting::Layout::I> items)
void addRow(std::initializer_list<Layouting::Layout::I> items)
void align(Qt::Alignment alignment)
void attachTo(QWidget *widget)
QWidget *emerge() const
void flush()
void setNoMargins()
void setNormalMargins()
void span(int cols, int rows)

Descrizione dettagliata

Incorpora un oggetto derivato da ` QLayout`. Le istanze sono effimere: creare, configurare e chiamare ` attachTo()` o ` emerge()`. Non conservarle oltre la funzione che le contiene.

Le sottoclassi accumulano elementi tramite addItem(), addItems() e addRow(), che vengono scaricati nel QLayout sottostante quando il builder viene finalizzato. Per i layout che supportano righe e span (Form, Grid), gli elementi vengono preparati e inseriti nel layout tramite flush().

Vedi anche Layouting::Widget, Layouting::Column, Layouting::Row, Layouting::Form e Layouting::Grid.

Documentazione delle funzioni membro

void Layout::addItem(Layouting::Layout::I item)

Aggiunge l'elemento di layout " item " come sottoelemento.

void Layout::addItems(std::initializer_list<Layouting::Layout::I> items)

Aggiunge gli elementi di layout “ items ” come sottoelementi.

void Layout::addRow(std::initializer_list<Layouting::Layout::I> items)

Inizia una nuova riga contenente items. La riga può essere ulteriormente estesa con altri elementi utilizzando addItem() o addItems().

Vedi anche addItem() e addItems().

void Layout::align(Qt::Alignment alignment)

Imposta l'allineamento su " alignment " per l'ultimo elemento aggiunto a questo layout. Ha senso solo per i layout "Grid" e "Form".

void Layout::attachTo(QWidget *widget)

Associa il layout creato all'QWidget fornito widget.

Questa operazione può essere eseguita solo una volta per ogni istanza di LayoutBuilder.

QWidget *Layout::emerge() const

Definisce il layout e lo restituisce racchiuso in un nuovo elemento ` QWidget`.

Ciò è utile quando un layout deve essere incorporato come widget (ad esempio all’interno di un ` QScrollArea ` o di un ` QStackedWidget`) senza un builder `Widget` esterno esplicito. Chi chiama la funzione assume la proprietà del widget restituito.

Vedi anche Layout::attachTo().

void Layout::flush()

Convalida tutte le voci in sospeso accumulate nell'QLayout sottostante.

Per i layout Grid, ogni chiamata a `flush()` fa avanzare alla riga successiva. Per i layout Form, ogni chiamata a `flush()` aggiunge una riga di etichetta-campo (o una singola riga a larghezza intera). Per i layout box e flow, gli elementi vengono aggiunti direttamente e `flush()` non ha alcun effetto.

flush() viene chiamato automaticamente alla fine di un costruttore che accetta una lista di inizializzazione, nonché dai metodi ` attachTo()` e ` emerge()`. Chiamarlo manualmente solo quando si costruisce un layout passo dopo passo con ` addItem()` o ` addRow()`.

Vedi anche Layout::attachTo() e Layout::emerge().

void Layout::setNoMargins()

Imposta a zero tutti e quattro i margini del contenuto.

Vedi anche Layout::setNormalMargins() e Layouting::noMargin.

void Layout::setNormalMargins()

Imposta tutti e quattro i margini del contenuto a 9 pixel.

Vedi anche Layout::setNoMargins() e Layouting::normalMargin.

void Layout::span(int cols, int rows)

Imposta l’estensione della colonna su cols e quella della riga su rows per l’ultimo elemento aggiunto a questo layout. Ha senso solo per i layout a griglia.

Vedi anche Layouting::Span e Layouting::SpanAll.

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.