QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
qgslayoutmanualtablewidget.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutmanualtablewidget.h
3 ---------------------------------
4 begin : January 2020
5 copyright : (C) 2020 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
19#include "moc_qgslayoutmanualtablewidget.cpp"
20#include "qgslayoutatlas.h"
21#include "qgslayout.h"
23#include "qgsprintlayout.h"
24#include "qgslayoutframe.h"
25#include "qgslayoutitemwidget.h"
28#include "qgsguiutils.h"
30
32 : QgsLayoutItemBaseWidget( nullptr, frame ? qobject_cast< QgsLayoutItemManualTable* >( frame->multiFrame() ) : nullptr )
33 , mTable( frame ? qobject_cast< QgsLayoutItemManualTable* >( frame->multiFrame() ) : nullptr )
34 , mFrame( frame )
35{
36 setupUi( this );
37
38 connect( mSetContentsButton, &QPushButton::clicked, this, &QgsLayoutManualTableWidget::setTableContents );
39 connect( mMarginSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutManualTableWidget::mMarginSpinBox_valueChanged );
40 connect( mGridStrokeWidthSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutManualTableWidget::mGridStrokeWidthSpinBox_valueChanged );
41 connect( mGridColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutManualTableWidget::mGridColorButton_colorChanged );
42 connect( mBackgroundColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutManualTableWidget::mBackgroundColorButton_colorChanged );
43 connect( mDrawHorizontalGrid, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mDrawHorizontalGrid_toggled );
44 connect( mDrawVerticalGrid, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mDrawVerticalGrid_toggled );
45 connect( mShowGridGroupCheckBox, &QgsCollapsibleGroupBoxBasic::toggled, this, &QgsLayoutManualTableWidget::mShowGridGroupCheckBox_toggled );
46 connect( mHeaderHAlignmentComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutManualTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged );
47 connect( mHeaderModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutManualTableWidget::mHeaderModeComboBox_currentIndexChanged );
48 connect( mAddFramePushButton, &QPushButton::clicked, this, &QgsLayoutManualTableWidget::mAddFramePushButton_clicked );
49 connect( mResizeModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutManualTableWidget::mResizeModeComboBox_currentIndexChanged );
50 connect( mDrawEmptyCheckBox, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mDrawEmptyCheckBox_toggled );
51 connect( mEmptyFrameCheckBox, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mEmptyFrameCheckBox_toggled );
52 connect( mHideEmptyBgCheckBox, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mHideEmptyBgCheckBox_toggled );
53 connect( mWrapBehaviorComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutManualTableWidget::mWrapBehaviorComboBox_currentIndexChanged );
54 connect( mAdvancedCustomizationButton, &QPushButton::clicked, this, &QgsLayoutManualTableWidget::mAdvancedCustomizationButton_clicked );
55 setPanelTitle( tr( "Table Properties" ) );
56
57 mContentFontToolButton->setMode( QgsFontButton::ModeTextRenderer );
58 mHeaderFontToolButton->setMode( QgsFontButton::ModeTextRenderer );
59
60 mContentFontToolButton->registerExpressionContextGenerator( this );
61 mHeaderFontToolButton->registerExpressionContextGenerator( this );
62
63 blockAllSignals( true );
64
65 mResizeModeComboBox->addItem( tr( "Use Existing Frames" ), QgsLayoutMultiFrame::UseExistingFrames );
66 mResizeModeComboBox->addItem( tr( "Extend to Next Page" ), QgsLayoutMultiFrame::ExtendToNextPage );
67 mResizeModeComboBox->addItem( tr( "Repeat Until Finished" ), QgsLayoutMultiFrame::RepeatUntilFinished );
68
69 mWrapBehaviorComboBox->addItem( tr( "Truncate Text" ), QgsLayoutTable::TruncateText );
70 mWrapBehaviorComboBox->addItem( tr( "Wrap Text" ), QgsLayoutTable::WrapText );
71
72 mHeaderModeComboBox->addItem( tr( "On First Frame" ), QgsLayoutTable::FirstFrame );
73 mHeaderModeComboBox->addItem( tr( "On All Frames" ), QgsLayoutTable::AllFrames );
74 mHeaderModeComboBox->addItem( tr( "No Header" ), QgsLayoutTable::NoHeaders );
75
76 mHeaderHAlignmentComboBox->addItem( tr( "Follow Column Alignment" ), QgsLayoutTable::FollowColumn );
77 mHeaderHAlignmentComboBox->addItem( tr( "Left" ), QgsLayoutTable::HeaderLeft );
78 mHeaderHAlignmentComboBox->addItem( tr( "Center" ), QgsLayoutTable::HeaderCenter );
79 mHeaderHAlignmentComboBox->addItem( tr( "Right" ), QgsLayoutTable::HeaderRight );
80
81 mGridColorButton->setColorDialogTitle( tr( "Select Grid Color" ) );
82 mGridColorButton->setAllowOpacity( true );
83 mGridColorButton->setContext( QStringLiteral( "composer" ) );
84 mGridColorButton->setDefaultColor( Qt::black );
85 mBackgroundColorButton->setColorDialogTitle( tr( "Select Background Color" ) );
86 mBackgroundColorButton->setAllowOpacity( true );
87 mBackgroundColorButton->setContext( QStringLiteral( "composer" ) );
88 mBackgroundColorButton->setShowNoColor( true );
89 mBackgroundColorButton->setNoColorString( tr( "No Background" ) );
90
91 updateGuiElements();
92
93 if ( mTable )
94 {
95 connect( mTable, &QgsLayoutMultiFrame::changed, this, &QgsLayoutManualTableWidget::updateGuiElements );
96 }
97
98 //embed widget for general options
99 if ( mFrame )
100 {
101 //add widget for general composer item properties
102 mItemPropertiesWidget = new QgsLayoutItemPropertiesWidget( this, mFrame );
103 mainLayout->addWidget( mItemPropertiesWidget );
104 }
105
106 connect( mHeaderFontToolButton, &QgsFontButton::changed, this, &QgsLayoutManualTableWidget::headerFontChanged );
107 connect( mContentFontToolButton, &QgsFontButton::changed, this, &QgsLayoutManualTableWidget::contentFontChanged );
108}
109
111{
112 if ( mItemPropertiesWidget )
113 mItemPropertiesWidget->setMasterLayout( masterLayout );
114}
115
117{
118 QgsExpressionContext context;
119
120 // frames include their parent multiframe's context, so prefer that if possible
121 if ( mFrame )
122 context = mFrame->createExpressionContext();
123 else if ( mTable )
124 context = mTable->createExpressionContext();
125
126 std::unique_ptr< QgsExpressionContextScope > cellScope = std::make_unique< QgsExpressionContextScope >();
127 cellScope->setVariable( QStringLiteral( "row_number" ), 1, true );
128 cellScope->setVariable( QStringLiteral( "column_number" ), 1, true );
129 context.appendScope( cellScope.release() );
130
131 context.setHighlightedVariables( { QStringLiteral( "row_number" ),
132 QStringLiteral( "column_number" )} );
133
134 return context;
135}
136
138{
139 QgsLayoutFrame *frame = qobject_cast< QgsLayoutFrame * >( item );
140 if ( !frame )
141 return false;
142
143 QgsLayoutMultiFrame *multiFrame = frame->multiFrame();
144 if ( !multiFrame )
145 return false;
146
147 if ( multiFrame->type() != QgsLayoutItemRegistry::LayoutManualTable )
148 return false;
149
150 if ( mTable )
151 {
152 disconnect( mTable, &QgsLayoutObject::changed, this, &QgsLayoutManualTableWidget::updateGuiElements );
153 }
154 if ( mEditorDialog )
155 {
156 mEditorDialog->close();
157 }
158
159 mTable = qobject_cast< QgsLayoutItemManualTable * >( multiFrame );
160 mFrame = frame;
161 mItemPropertiesWidget->setItem( frame );
162
163 if ( mTable )
164 {
165 connect( mTable, &QgsLayoutObject::changed, this, &QgsLayoutManualTableWidget::updateGuiElements );
166 }
167
168 updateGuiElements();
169
170 return true;
171}
172
173void QgsLayoutManualTableWidget::setTableContents()
174{
175 if ( !mTable )
176 {
177 return;
178 }
179
180 if ( mEditorDialog )
181 {
182 // the unholy quadfecta
183 mEditorDialog->show();
184 mEditorDialog->raise();
185 mEditorDialog->setWindowState( windowState() & ~Qt::WindowMinimized );
186 mEditorDialog->activateWindow();
187 }
188 else
189 {
190 mEditorDialog = new QgsTableEditorDialog( this );
191 if ( QgsLayout *layout = mTable->layout() )
192 {
193 mEditorDialog->setLayer( layout->reportContext().layer() );
194 }
195 mEditorDialog->registerExpressionContextGenerator( mTable );
196 connect( this, &QWidget::destroyed, mEditorDialog, &QMainWindow::close );
197
198 mEditorDialog->setIncludeTableHeader( mTable->includeTableHeader() );
199 mEditorDialog->setTableContents( mTable->tableContents() );
200
201 int row = 0;
202 const QList< double > rowHeights = mTable->rowHeights();
203 for ( const double height : rowHeights )
204 {
205 mEditorDialog->setTableRowHeight( row, height );
206 row++;
207 }
208 int col = 0;
209 const QList< double > columnWidths = mTable->columnWidths();
210 QVariantList headers;
211 headers.reserve( columnWidths.size() );
212 for ( const double width : columnWidths )
213 {
214 mEditorDialog->setTableColumnWidth( col, width );
215 headers << ( col < mTable->headers().count() ? mTable->headers().value( col ).heading() : QVariant() );
216 col++;
217 }
218 mEditorDialog->setTableHeaders( headers );
219
220 connect( mEditorDialog, &QgsTableEditorDialog::tableChanged, this, [ = ]
221 {
222 if ( mTable )
223 {
224 mTable->beginCommand( tr( "Change Table Contents" ) );
225 mTable->setTableContents( mEditorDialog->tableContents() );
226
227 const QVariantList headerText = mEditorDialog->tableHeaders();
228 if ( mEditorDialog->includeTableHeader() )
229 {
230 QgsLayoutTableColumns headers;
231 for ( const QVariant &h : headerText )
232 {
233 headers << QgsLayoutTableColumn( h.toString() );
234 }
235 mTable->setHeaders( headers );
236 }
237
238 const int rowCount = mTable->tableContents().size();
239 QList< double > rowHeights;
240 rowHeights.reserve( rowCount );
241 for ( int row = 0; row < rowCount; ++row )
242 {
243 rowHeights << mEditorDialog->tableRowHeight( row );
244 }
245 mTable->setRowHeights( rowHeights );
246
247 if ( !mTable->tableContents().empty() )
248 {
249 const int columnCount = mTable->tableContents().at( 0 ).size();
250 QList< double > columnWidths;
251 columnWidths.reserve( columnCount );
252 for ( int col = 0; col < columnCount; ++col )
253 {
254 columnWidths << mEditorDialog->tableColumnWidth( col );
255 }
256 mTable->setColumnWidths( columnWidths );
257 }
258
259 mTable->endCommand();
260 }
261 } );
262
263 connect( mEditorDialog, &QgsTableEditorDialog::includeHeaderChanged, this, [ = ]( bool included )
264 {
265 if ( mTable )
266 {
267 mTable->beginCommand( tr( "Change Table Header" ) );
268 mTable->setIncludeTableHeader( included );
269 mTable->endCommand();
270 }
271 } );
272 mEditorDialog->show();
273 }
274}
275
276void QgsLayoutManualTableWidget::mMarginSpinBox_valueChanged( double d )
277{
278 if ( !mTable )
279 {
280 return;
281 }
282
283 mTable->beginCommand( tr( "Change Table Margin" ), QgsLayoutMultiFrame::UndoTableMargin );
284 mTable->setCellMargin( d );
285 mTable->endCommand();
286}
287
288void QgsLayoutManualTableWidget::contentFontChanged()
289{
290 if ( !mTable )
291 {
292 return;
293 }
294
295 mTable->beginCommand( tr( "Change Table Font" ) );
296 mTable->setContentTextFormat( mContentFontToolButton->textFormat() );
297 mTable->endCommand();
298}
299
300void QgsLayoutManualTableWidget::mGridStrokeWidthSpinBox_valueChanged( double d )
301{
302 if ( !mTable )
303 {
304 return;
305 }
306
307 mTable->beginCommand( tr( "Change Table Line Width" ), QgsLayoutMultiFrame::UndoTableGridStrokeWidth );
308 mTable->setGridStrokeWidth( d );
309 mTable->endCommand();
310}
311
312void QgsLayoutManualTableWidget::mGridColorButton_colorChanged( const QColor &newColor )
313{
314 if ( !mTable )
315 {
316 return;
317 }
318
319 mTable->beginCommand( tr( "Change Table Grid Color" ), QgsLayoutMultiFrame::UndoTableGridColor );
320 mTable->setGridColor( newColor );
321 mTable->endCommand();
322}
323
324void QgsLayoutManualTableWidget::mDrawHorizontalGrid_toggled( bool state )
325{
326 if ( !mTable )
327 {
328 return;
329 }
330
331 mTable->beginCommand( tr( "Toggle Table Grid" ) );
332 mTable->setHorizontalGrid( state );
333 mTable->endCommand();
334}
335
336void QgsLayoutManualTableWidget::mDrawVerticalGrid_toggled( bool state )
337{
338 if ( !mTable )
339 {
340 return;
341 }
342
343 mTable->beginCommand( tr( "Toggled Table Grid" ) );
344 mTable->setVerticalGrid( state );
345 mTable->endCommand();
346}
347
348void QgsLayoutManualTableWidget::mShowGridGroupCheckBox_toggled( bool state )
349{
350 if ( !mTable )
351 {
352 return;
353 }
354
355 mTable->beginCommand( tr( "Toggle Table Grid" ) );
356 mTable->setShowGrid( state );
357 mTable->endCommand();
358}
359
360void QgsLayoutManualTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged( int )
361{
362 if ( !mTable )
363 {
364 return;
365 }
366
367 mTable->beginCommand( tr( "Change Table Alignment" ) );
368 mTable->setHeaderHAlignment( static_cast< QgsLayoutTable::HeaderHAlignment >( mHeaderHAlignmentComboBox->currentData().toInt() ) );
369 mTable->endCommand();
370}
371
372void QgsLayoutManualTableWidget::mHeaderModeComboBox_currentIndexChanged( int )
373{
374 if ( !mTable )
375 {
376 return;
377 }
378
379 mTable->beginCommand( tr( "Change Table Header Mode" ) );
380 mTable->setHeaderMode( static_cast< QgsLayoutTable::HeaderMode >( mHeaderModeComboBox->currentData().toInt() ) );
381 mTable->endCommand();
382}
383
384void QgsLayoutManualTableWidget::mBackgroundColorButton_colorChanged( const QColor &newColor )
385{
386 if ( !mTable )
387 {
388 return;
389 }
390
391 mTable->beginCommand( tr( "Change Table Color" ), QgsLayoutMultiFrame::UndoTableBackgroundColor );
392 mTable->setBackgroundColor( newColor );
393 mTable->endCommand();
394}
395
396void QgsLayoutManualTableWidget::headerFontChanged()
397{
398 if ( !mTable )
399 return;
400
401 mTable->beginCommand( tr( "Change Table Font" ) );
402 mTable->setHeaderTextFormat( mHeaderFontToolButton->textFormat() );
403 mTable->endCommand();
404}
405
406void QgsLayoutManualTableWidget::updateGuiElements()
407{
408 if ( !mTable || !mFrame )
409 {
410 return;
411 }
412
413 blockAllSignals( true );
414
415 mMarginSpinBox->setValue( mTable->cellMargin() );
416 mGridStrokeWidthSpinBox->setValue( mTable->gridStrokeWidth() );
417 mGridColorButton->setColor( mTable->gridColor() );
418 mDrawHorizontalGrid->setChecked( mTable->horizontalGrid() );
419 mDrawVerticalGrid->setChecked( mTable->verticalGrid() );
420 if ( mTable->showGrid() )
421 {
422 mShowGridGroupCheckBox->setChecked( true );
423 }
424 else
425 {
426 mShowGridGroupCheckBox->setChecked( false );
427 }
428 mBackgroundColorButton->setColor( mTable->backgroundColor() );
429
430 mHeaderFontToolButton->setTextFormat( mTable->headerTextFormat() );
431 mContentFontToolButton->setTextFormat( mTable->contentTextFormat() );
432
433 mDrawEmptyCheckBox->setChecked( mTable->showEmptyRows() );
434 mWrapBehaviorComboBox->setCurrentIndex( mWrapBehaviorComboBox->findData( mTable->wrapBehavior() ) );
435
436 mResizeModeComboBox->setCurrentIndex( mResizeModeComboBox->findData( mTable->resizeMode() ) );
437 mAddFramePushButton->setEnabled( mTable->resizeMode() == QgsLayoutMultiFrame::UseExistingFrames );
438
439 mHeaderHAlignmentComboBox->setCurrentIndex( mHeaderHAlignmentComboBox->findData( mTable->headerHAlignment() ) );
440 mHeaderModeComboBox->setCurrentIndex( mHeaderModeComboBox->findData( mTable->headerMode() ) );
441
442 mEmptyFrameCheckBox->setChecked( mFrame->hidePageIfEmpty() );
443 mHideEmptyBgCheckBox->setChecked( mFrame->hideBackgroundIfEmpty() );
444
445 blockAllSignals( false );
446}
447
448void QgsLayoutManualTableWidget::blockAllSignals( bool b )
449{
450 mMarginSpinBox->blockSignals( b );
451 mGridColorButton->blockSignals( b );
452 mGridStrokeWidthSpinBox->blockSignals( b );
453 mBackgroundColorButton->blockSignals( b );
454 mDrawHorizontalGrid->blockSignals( b );
455 mDrawVerticalGrid->blockSignals( b );
456 mShowGridGroupCheckBox->blockSignals( b );
457 mResizeModeComboBox->blockSignals( b );
458 mEmptyFrameCheckBox->blockSignals( b );
459 mHideEmptyBgCheckBox->blockSignals( b );
460 mDrawEmptyCheckBox->blockSignals( b );
461 mWrapBehaviorComboBox->blockSignals( b );
462 mContentFontToolButton->blockSignals( b );
463 mHeaderHAlignmentComboBox->blockSignals( b );
464 mHeaderModeComboBox->blockSignals( b );
465 mHeaderFontToolButton->blockSignals( b );
466}
467
468void QgsLayoutManualTableWidget::mEmptyFrameCheckBox_toggled( bool checked )
469{
470 if ( !mFrame )
471 {
472 return;
473 }
474
475 mFrame->beginCommand( tr( "Toggle Empty Frame Mode" ) );
476 mFrame->setHidePageIfEmpty( checked );
477 mFrame->endCommand();
478}
479
480void QgsLayoutManualTableWidget::mHideEmptyBgCheckBox_toggled( bool checked )
481{
482 if ( !mFrame )
483 {
484 return;
485 }
486
487 mFrame->beginCommand( tr( "Toggle Background Display" ) );
488 mFrame->setHideBackgroundIfEmpty( checked );
489 mFrame->endCommand();
490}
491
492void QgsLayoutManualTableWidget::mAddFramePushButton_clicked()
493{
494 if ( !mTable || !mFrame )
495 {
496 return;
497 }
498
499 //create a new frame based on the current frame
500 QPointF pos = mFrame->pos();
501 //shift new frame so that it sits 10 units below current frame
502 pos.ry() += mFrame->rect().height() + 10;
503
504 QgsLayoutFrame *newFrame = mTable->createNewFrame( mFrame, pos, mFrame->rect().size() );
505 mTable->recalculateFrameSizes();
506
507 //set new frame as selection
508 if ( QgsLayout *layout = mTable->layout() )
509 {
510 layout->setSelectedItem( newFrame );
511 }
512}
513
514void QgsLayoutManualTableWidget::mResizeModeComboBox_currentIndexChanged( int index )
515{
516 if ( !mTable )
517 {
518 return;
519 }
520
521 mTable->beginCommand( tr( "Change Resize Mode" ) );
522 mTable->setResizeMode( static_cast< QgsLayoutMultiFrame::ResizeMode >( mResizeModeComboBox->itemData( index ).toInt() ) );
523 mTable->endCommand();
524
525 mAddFramePushButton->setEnabled( mTable->resizeMode() == QgsLayoutMultiFrame::UseExistingFrames );
526}
527
528void QgsLayoutManualTableWidget::mWrapBehaviorComboBox_currentIndexChanged( int index )
529{
530 if ( !mTable )
531 {
532 return;
533 }
534
535 mTable->beginCommand( tr( "Change Table Wrap Mode" ) );
536 mTable->setWrapBehavior( static_cast< QgsLayoutTable::WrapBehavior >( mWrapBehaviorComboBox->itemData( index ).toInt() ) );
537 mTable->endCommand();
538}
539
540void QgsLayoutManualTableWidget::mAdvancedCustomizationButton_clicked()
541{
542 if ( !mTable )
543 {
544 return;
545 }
546
547 QgsLayoutTableBackgroundColorsDialog d( mTable, this );
548
549 d.exec();
550}
551
552void QgsLayoutManualTableWidget::mDrawEmptyCheckBox_toggled( bool checked )
553{
554 if ( !mTable )
555 {
556 return;
557 }
558
559 mTable->beginCommand( tr( "Change Show Empty Rows" ) );
560 mTable->setShowEmptyRows( checked );
561 mTable->endCommand();
562}
563
void colorChanged(const QColor &color)
Emitted whenever a new color is set for the button.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
void setHighlightedVariables(const QStringList &variableNames)
Sets the list of variable names within the context intended to be highlighted to the user.
@ ModeTextRenderer
Configure font settings for use with QgsTextRenderer.
void changed()
Emitted when the widget's text format settings are changed.
Base class for frame items, which form a layout multiframe item.
QgsLayoutMultiFrame * multiFrame() const
Returns the parent multiframe for the frame.
A base class for property widgets for layout items.
A layout table subclass that displays manually entered (and formatted) content.
A widget for controlling the common properties of layout items (e.g.
void setMasterLayout(QgsMasterLayoutInterface *masterLayout)
Sets the master layout associated with the item.
void setItem(QgsLayoutItem *item)
Sets the layout item.
@ LayoutManualTable
Manual (fixed) table.
Base class for graphical items within a QgsLayout.
void setMasterLayout(QgsMasterLayoutInterface *masterLayout) override
Sets the master layout associated with the item.
bool setNewItem(QgsLayoutItem *item) override
Attempts to update the widget to show the properties for the specified item.
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QgsLayoutManualTableWidget(QgsLayoutFrame *frame)
constructor
Abstract base class for layout items with the ability to distribute the content to several frames (Qg...
virtual int type() const =0
Returns unique multiframe type id.
ResizeMode
Specifies the behavior for creating new frames to fit the multiframe's content.
@ UseExistingFrames
Don't automatically create new frames, just use existing frames.
@ ExtendToNextPage
Creates new full page frames on the following page(s) until the entire multiframe content is visible.
@ UndoTableBackgroundColor
Table background color.
@ UndoTableGridStrokeWidth
Table grid stroke width.
@ UndoTableGridColor
Table grid color.
@ UndoTableMargin
Table margins.
void changed()
Emitted when the object's properties change.
A dialog for customization of the cell background colors for a QgsLayoutTable.
Stores properties of a column for a QgsLayoutTable.
HeaderMode
Controls where headers are shown in the table.
@ FirstFrame
Header shown on first frame only.
@ AllFrames
Headers shown on all frames.
@ NoHeaders
No headers shown for table.
WrapBehavior
Controls how long strings in the table are handled.
@ WrapText
Text which doesn't fit inside the cell is wrapped. Note that this only applies to text in columns wit...
@ TruncateText
Text which doesn't fit inside the cell is truncated.
HeaderHAlignment
Controls how headers are horizontally aligned in a table.
@ HeaderRight
Align headers right.
@ HeaderLeft
Align headers left.
@ HeaderCenter
Align headers to center.
@ FollowColumn
Header uses the same alignment as the column.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition qgslayout.h:49
Interface for master layout type objects, such as print layouts and reports.
void setPanelTitle(const QString &panelTitle)
Set the title of the panel when shown in the interface.
A reusable window for editing simple spreadsheet-style tables.
void includeHeaderChanged(bool included)
Emitted whenever the "include table header" setting is changed.
void tableChanged()
Emitted whenever the table contents are changed.
QVector< QgsLayoutTableColumn > QgsLayoutTableColumns
List of column definitions for a QgsLayoutTable.