QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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 "qgslayoutatlas.h"
20#include "qgslayout.h"
22#include "qgsprintlayout.h"
23#include "qgslayoutframe.h"
24#include "qgslayoutitemwidget.h"
27#include "qgsguiutils.h"
29
31 : QgsLayoutItemBaseWidget( nullptr, frame ? qobject_cast< QgsLayoutItemManualTable* >( frame->multiFrame() ) : nullptr )
32 , mTable( frame ? qobject_cast< QgsLayoutItemManualTable* >( frame->multiFrame() ) : nullptr )
33 , mFrame( frame )
34{
35 setupUi( this );
36
37 connect( mSetContentsButton, &QPushButton::clicked, this, &QgsLayoutManualTableWidget::setTableContents );
38 connect( mMarginSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutManualTableWidget::mMarginSpinBox_valueChanged );
39 connect( mGridStrokeWidthSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutManualTableWidget::mGridStrokeWidthSpinBox_valueChanged );
40 connect( mGridColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutManualTableWidget::mGridColorButton_colorChanged );
41 connect( mBackgroundColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutManualTableWidget::mBackgroundColorButton_colorChanged );
42 connect( mDrawHorizontalGrid, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mDrawHorizontalGrid_toggled );
43 connect( mDrawVerticalGrid, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mDrawVerticalGrid_toggled );
44 connect( mShowGridGroupCheckBox, &QgsCollapsibleGroupBoxBasic::toggled, this, &QgsLayoutManualTableWidget::mShowGridGroupCheckBox_toggled );
45 connect( mHeaderHAlignmentComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutManualTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged );
46 connect( mHeaderModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutManualTableWidget::mHeaderModeComboBox_currentIndexChanged );
47 connect( mAddFramePushButton, &QPushButton::clicked, this, &QgsLayoutManualTableWidget::mAddFramePushButton_clicked );
48 connect( mResizeModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutManualTableWidget::mResizeModeComboBox_currentIndexChanged );
49 connect( mDrawEmptyCheckBox, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mDrawEmptyCheckBox_toggled );
50 connect( mEmptyFrameCheckBox, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mEmptyFrameCheckBox_toggled );
51 connect( mHideEmptyBgCheckBox, &QCheckBox::toggled, this, &QgsLayoutManualTableWidget::mHideEmptyBgCheckBox_toggled );
52 connect( mWrapBehaviorComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutManualTableWidget::mWrapBehaviorComboBox_currentIndexChanged );
53 connect( mAdvancedCustomizationButton, &QPushButton::clicked, this, &QgsLayoutManualTableWidget::mAdvancedCustomizationButton_clicked );
54 setPanelTitle( tr( "Table Properties" ) );
55
56 mContentFontToolButton->setMode( QgsFontButton::ModeTextRenderer );
57 mHeaderFontToolButton->setMode( QgsFontButton::ModeTextRenderer );
58
59 mContentFontToolButton->registerExpressionContextGenerator( this );
60 mHeaderFontToolButton->registerExpressionContextGenerator( this );
61
62 blockAllSignals( true );
63
64 mResizeModeComboBox->addItem( tr( "Use Existing Frames" ), QgsLayoutMultiFrame::UseExistingFrames );
65 mResizeModeComboBox->addItem( tr( "Extend to Next Page" ), QgsLayoutMultiFrame::ExtendToNextPage );
66 mResizeModeComboBox->addItem( tr( "Repeat Until Finished" ), QgsLayoutMultiFrame::RepeatUntilFinished );
67
68 mWrapBehaviorComboBox->addItem( tr( "Truncate Text" ), QgsLayoutTable::TruncateText );
69 mWrapBehaviorComboBox->addItem( tr( "Wrap Text" ), QgsLayoutTable::WrapText );
70
71 mHeaderModeComboBox->addItem( tr( "On First Frame" ), QgsLayoutTable::FirstFrame );
72 mHeaderModeComboBox->addItem( tr( "On All Frames" ), QgsLayoutTable::AllFrames );
73 mHeaderModeComboBox->addItem( tr( "No Header" ), QgsLayoutTable::NoHeaders );
74
75 mHeaderHAlignmentComboBox->addItem( tr( "Follow Column Alignment" ), QgsLayoutTable::FollowColumn );
76 mHeaderHAlignmentComboBox->addItem( tr( "Left" ), QgsLayoutTable::HeaderLeft );
77 mHeaderHAlignmentComboBox->addItem( tr( "Center" ), QgsLayoutTable::HeaderCenter );
78 mHeaderHAlignmentComboBox->addItem( tr( "Right" ), QgsLayoutTable::HeaderRight );
79
80 mGridColorButton->setColorDialogTitle( tr( "Select Grid Color" ) );
81 mGridColorButton->setAllowOpacity( true );
82 mGridColorButton->setContext( QStringLiteral( "composer" ) );
83 mGridColorButton->setDefaultColor( Qt::black );
84 mBackgroundColorButton->setColorDialogTitle( tr( "Select Background Color" ) );
85 mBackgroundColorButton->setAllowOpacity( true );
86 mBackgroundColorButton->setContext( QStringLiteral( "composer" ) );
87 mBackgroundColorButton->setShowNoColor( true );
88 mBackgroundColorButton->setNoColorString( tr( "No Background" ) );
89
90 updateGuiElements();
91
92 if ( mTable )
93 {
94 connect( mTable, &QgsLayoutMultiFrame::changed, this, &QgsLayoutManualTableWidget::updateGuiElements );
95 }
96
97 //embed widget for general options
98 if ( mFrame )
99 {
100 //add widget for general composer item properties
101 mItemPropertiesWidget = new QgsLayoutItemPropertiesWidget( this, mFrame );
102 mainLayout->addWidget( mItemPropertiesWidget );
103 }
104
105 connect( mHeaderFontToolButton, &QgsFontButton::changed, this, &QgsLayoutManualTableWidget::headerFontChanged );
106 connect( mContentFontToolButton, &QgsFontButton::changed, this, &QgsLayoutManualTableWidget::contentFontChanged );
107}
108
110{
111 if ( mItemPropertiesWidget )
112 mItemPropertiesWidget->setMasterLayout( masterLayout );
113}
114
116{
117 QgsExpressionContext context;
118
119 // frames include their parent multiframe's context, so prefer that if possible
120 if ( mFrame )
121 context = mFrame->createExpressionContext();
122 else if ( mTable )
123 context = mTable->createExpressionContext();
124
125 std::unique_ptr< QgsExpressionContextScope > cellScope = std::make_unique< QgsExpressionContextScope >();
126 cellScope->setVariable( QStringLiteral( "row_number" ), 1, true );
127 cellScope->setVariable( QStringLiteral( "column_number" ), 1, true );
128 context.appendScope( cellScope.release() );
129
130 context.setHighlightedVariables( { QStringLiteral( "row_number" ),
131 QStringLiteral( "column_number" )} );
132
133 return context;
134}
135
137{
138 QgsLayoutFrame *frame = qobject_cast< QgsLayoutFrame * >( item );
139 if ( !frame )
140 return false;
141
142 QgsLayoutMultiFrame *multiFrame = frame->multiFrame();
143 if ( !multiFrame )
144 return false;
145
146 if ( multiFrame->type() != QgsLayoutItemRegistry::LayoutManualTable )
147 return false;
148
149 if ( mTable )
150 {
151 disconnect( mTable, &QgsLayoutObject::changed, this, &QgsLayoutManualTableWidget::updateGuiElements );
152 }
153 if ( mEditorDialog )
154 {
155 mEditorDialog->close();
156 }
157
158 mTable = qobject_cast< QgsLayoutItemManualTable * >( multiFrame );
159 mFrame = frame;
160 mItemPropertiesWidget->setItem( frame );
161
162 if ( mTable )
163 {
164 connect( mTable, &QgsLayoutObject::changed, this, &QgsLayoutManualTableWidget::updateGuiElements );
165 }
166
167 updateGuiElements();
168
169 return true;
170}
171
172void QgsLayoutManualTableWidget::setTableContents()
173{
174 if ( !mTable )
175 {
176 return;
177 }
178
179 if ( mEditorDialog )
180 {
181 // the unholy quadfecta
182 mEditorDialog->show();
183 mEditorDialog->raise();
184 mEditorDialog->setWindowState( windowState() & ~Qt::WindowMinimized );
185 mEditorDialog->activateWindow();
186 }
187 else
188 {
189 mEditorDialog = new QgsTableEditorDialog( this );
190 if ( QgsLayout *layout = mTable->layout() )
191 {
192 mEditorDialog->setLayer( layout->reportContext().layer() );
193 }
194 mEditorDialog->registerExpressionContextGenerator( mTable );
195 connect( this, &QWidget::destroyed, mEditorDialog, &QMainWindow::close );
196
197 mEditorDialog->setIncludeTableHeader( mTable->includeTableHeader() );
198 mEditorDialog->setTableContents( mTable->tableContents() );
199
200 int row = 0;
201 const QList< double > rowHeights = mTable->rowHeights();
202 for ( const double height : rowHeights )
203 {
204 mEditorDialog->setTableRowHeight( row, height );
205 row++;
206 }
207 int col = 0;
208 const QList< double > columnWidths = mTable->columnWidths();
209 QVariantList headers;
210 headers.reserve( columnWidths.size() );
211 for ( const double width : columnWidths )
212 {
213 mEditorDialog->setTableColumnWidth( col, width );
214 headers << ( col < mTable->headers().count() ? mTable->headers().value( col ).heading() : QVariant() );
215 col++;
216 }
217 mEditorDialog->setTableHeaders( headers );
218
219 connect( mEditorDialog, &QgsTableEditorDialog::tableChanged, this, [ = ]
220 {
221 if ( mTable )
222 {
223 mTable->beginCommand( tr( "Change Table Contents" ) );
224 mTable->setTableContents( mEditorDialog->tableContents() );
225
226 const QVariantList headerText = mEditorDialog->tableHeaders();
227 if ( mEditorDialog->includeTableHeader() )
228 {
229 QgsLayoutTableColumns headers;
230 for ( const QVariant &h : headerText )
231 {
232 headers << QgsLayoutTableColumn( h.toString() );
233 }
234 mTable->setHeaders( headers );
235 }
236
237 const int rowCount = mTable->tableContents().size();
238 QList< double > rowHeights;
239 rowHeights.reserve( rowCount );
240 for ( int row = 0; row < rowCount; ++row )
241 {
242 rowHeights << mEditorDialog->tableRowHeight( row );
243 }
244 mTable->setRowHeights( rowHeights );
245
246 if ( !mTable->tableContents().empty() )
247 {
248 const int columnCount = mTable->tableContents().at( 0 ).size();
249 QList< double > columnWidths;
250 columnWidths.reserve( columnCount );
251 for ( int col = 0; col < columnCount; ++col )
252 {
253 columnWidths << mEditorDialog->tableColumnWidth( col );
254 }
255 mTable->setColumnWidths( columnWidths );
256 }
257
258 mTable->endCommand();
259 }
260 } );
261
262 connect( mEditorDialog, &QgsTableEditorDialog::includeHeaderChanged, this, [ = ]( bool included )
263 {
264 if ( mTable )
265 {
266 mTable->beginCommand( tr( "Change Table Header" ) );
267 mTable->setIncludeTableHeader( included );
268 mTable->endCommand();
269 }
270 } );
271 mEditorDialog->show();
272 }
273}
274
275void QgsLayoutManualTableWidget::mMarginSpinBox_valueChanged( double d )
276{
277 if ( !mTable )
278 {
279 return;
280 }
281
282 mTable->beginCommand( tr( "Change Table Margin" ), QgsLayoutMultiFrame::UndoTableMargin );
283 mTable->setCellMargin( d );
284 mTable->endCommand();
285}
286
287void QgsLayoutManualTableWidget::contentFontChanged()
288{
289 if ( !mTable )
290 {
291 return;
292 }
293
294 mTable->beginCommand( tr( "Change Table Font" ) );
295 mTable->setContentTextFormat( mContentFontToolButton->textFormat() );
296 mTable->endCommand();
297}
298
299void QgsLayoutManualTableWidget::mGridStrokeWidthSpinBox_valueChanged( double d )
300{
301 if ( !mTable )
302 {
303 return;
304 }
305
306 mTable->beginCommand( tr( "Change Table Line Width" ), QgsLayoutMultiFrame::UndoTableGridStrokeWidth );
307 mTable->setGridStrokeWidth( d );
308 mTable->endCommand();
309}
310
311void QgsLayoutManualTableWidget::mGridColorButton_colorChanged( const QColor &newColor )
312{
313 if ( !mTable )
314 {
315 return;
316 }
317
318 mTable->beginCommand( tr( "Change Table Grid Color" ), QgsLayoutMultiFrame::UndoTableGridColor );
319 mTable->setGridColor( newColor );
320 mTable->endCommand();
321}
322
323void QgsLayoutManualTableWidget::mDrawHorizontalGrid_toggled( bool state )
324{
325 if ( !mTable )
326 {
327 return;
328 }
329
330 mTable->beginCommand( tr( "Toggle Table Grid" ) );
331 mTable->setHorizontalGrid( state );
332 mTable->endCommand();
333}
334
335void QgsLayoutManualTableWidget::mDrawVerticalGrid_toggled( bool state )
336{
337 if ( !mTable )
338 {
339 return;
340 }
341
342 mTable->beginCommand( tr( "Toggled Table Grid" ) );
343 mTable->setVerticalGrid( state );
344 mTable->endCommand();
345}
346
347void QgsLayoutManualTableWidget::mShowGridGroupCheckBox_toggled( bool state )
348{
349 if ( !mTable )
350 {
351 return;
352 }
353
354 mTable->beginCommand( tr( "Toggle Table Grid" ) );
355 mTable->setShowGrid( state );
356 mTable->endCommand();
357}
358
359void QgsLayoutManualTableWidget::mHeaderHAlignmentComboBox_currentIndexChanged( int )
360{
361 if ( !mTable )
362 {
363 return;
364 }
365
366 mTable->beginCommand( tr( "Change Table Alignment" ) );
367 mTable->setHeaderHAlignment( static_cast< QgsLayoutTable::HeaderHAlignment >( mHeaderHAlignmentComboBox->currentData().toInt() ) );
368 mTable->endCommand();
369}
370
371void QgsLayoutManualTableWidget::mHeaderModeComboBox_currentIndexChanged( int )
372{
373 if ( !mTable )
374 {
375 return;
376 }
377
378 mTable->beginCommand( tr( "Change Table Header Mode" ) );
379 mTable->setHeaderMode( static_cast< QgsLayoutTable::HeaderMode >( mHeaderModeComboBox->currentData().toInt() ) );
380 mTable->endCommand();
381}
382
383void QgsLayoutManualTableWidget::mBackgroundColorButton_colorChanged( const QColor &newColor )
384{
385 if ( !mTable )
386 {
387 return;
388 }
389
390 mTable->beginCommand( tr( "Change Table Color" ), QgsLayoutMultiFrame::UndoTableBackgroundColor );
391 mTable->setBackgroundColor( newColor );
392 mTable->endCommand();
393}
394
395void QgsLayoutManualTableWidget::headerFontChanged()
396{
397 if ( !mTable )
398 return;
399
400 mTable->beginCommand( tr( "Change Table Font" ) );
401 mTable->setHeaderTextFormat( mHeaderFontToolButton->textFormat() );
402 mTable->endCommand();
403}
404
405void QgsLayoutManualTableWidget::updateGuiElements()
406{
407 if ( !mTable || !mFrame )
408 {
409 return;
410 }
411
412 blockAllSignals( true );
413
414 mMarginSpinBox->setValue( mTable->cellMargin() );
415 mGridStrokeWidthSpinBox->setValue( mTable->gridStrokeWidth() );
416 mGridColorButton->setColor( mTable->gridColor() );
417 mDrawHorizontalGrid->setChecked( mTable->horizontalGrid() );
418 mDrawVerticalGrid->setChecked( mTable->verticalGrid() );
419 if ( mTable->showGrid() )
420 {
421 mShowGridGroupCheckBox->setChecked( true );
422 }
423 else
424 {
425 mShowGridGroupCheckBox->setChecked( false );
426 }
427 mBackgroundColorButton->setColor( mTable->backgroundColor() );
428
429 mHeaderFontToolButton->setTextFormat( mTable->headerTextFormat() );
430 mContentFontToolButton->setTextFormat( mTable->contentTextFormat() );
431
432 mDrawEmptyCheckBox->setChecked( mTable->showEmptyRows() );
433 mWrapBehaviorComboBox->setCurrentIndex( mWrapBehaviorComboBox->findData( mTable->wrapBehavior() ) );
434
435 mResizeModeComboBox->setCurrentIndex( mResizeModeComboBox->findData( mTable->resizeMode() ) );
436 mAddFramePushButton->setEnabled( mTable->resizeMode() == QgsLayoutMultiFrame::UseExistingFrames );
437
438 mHeaderHAlignmentComboBox->setCurrentIndex( mHeaderHAlignmentComboBox->findData( mTable->headerHAlignment() ) );
439 mHeaderModeComboBox->setCurrentIndex( mHeaderModeComboBox->findData( mTable->headerMode() ) );
440
441 mEmptyFrameCheckBox->setChecked( mFrame->hidePageIfEmpty() );
442 mHideEmptyBgCheckBox->setChecked( mFrame->hideBackgroundIfEmpty() );
443
444 blockAllSignals( false );
445}
446
447void QgsLayoutManualTableWidget::blockAllSignals( bool b )
448{
449 mMarginSpinBox->blockSignals( b );
450 mGridColorButton->blockSignals( b );
451 mGridStrokeWidthSpinBox->blockSignals( b );
452 mBackgroundColorButton->blockSignals( b );
453 mDrawHorizontalGrid->blockSignals( b );
454 mDrawVerticalGrid->blockSignals( b );
455 mShowGridGroupCheckBox->blockSignals( b );
456 mResizeModeComboBox->blockSignals( b );
457 mEmptyFrameCheckBox->blockSignals( b );
458 mHideEmptyBgCheckBox->blockSignals( b );
459 mDrawEmptyCheckBox->blockSignals( b );
460 mWrapBehaviorComboBox->blockSignals( b );
461 mContentFontToolButton->blockSignals( b );
462 mHeaderHAlignmentComboBox->blockSignals( b );
463 mHeaderModeComboBox->blockSignals( b );
464 mHeaderFontToolButton->blockSignals( b );
465}
466
467void QgsLayoutManualTableWidget::mEmptyFrameCheckBox_toggled( bool checked )
468{
469 if ( !mFrame )
470 {
471 return;
472 }
473
474 mFrame->beginCommand( tr( "Toggle Empty Frame Mode" ) );
475 mFrame->setHidePageIfEmpty( checked );
476 mFrame->endCommand();
477}
478
479void QgsLayoutManualTableWidget::mHideEmptyBgCheckBox_toggled( bool checked )
480{
481 if ( !mFrame )
482 {
483 return;
484 }
485
486 mFrame->beginCommand( tr( "Toggle Background Display" ) );
487 mFrame->setHideBackgroundIfEmpty( checked );
488 mFrame->endCommand();
489}
490
491void QgsLayoutManualTableWidget::mAddFramePushButton_clicked()
492{
493 if ( !mTable || !mFrame )
494 {
495 return;
496 }
497
498 //create a new frame based on the current frame
499 QPointF pos = mFrame->pos();
500 //shift new frame so that it sits 10 units below current frame
501 pos.ry() += mFrame->rect().height() + 10;
502
503 QgsLayoutFrame *newFrame = mTable->createNewFrame( mFrame, pos, mFrame->rect().size() );
504 mTable->recalculateFrameSizes();
505
506 //set new frame as selection
507 if ( QgsLayout *layout = mTable->layout() )
508 {
509 layout->setSelectedItem( newFrame );
510 }
511}
512
513void QgsLayoutManualTableWidget::mResizeModeComboBox_currentIndexChanged( int index )
514{
515 if ( !mTable )
516 {
517 return;
518 }
519
520 mTable->beginCommand( tr( "Change Resize Mode" ) );
521 mTable->setResizeMode( static_cast< QgsLayoutMultiFrame::ResizeMode >( mResizeModeComboBox->itemData( index ).toInt() ) );
522 mTable->endCommand();
523
524 mAddFramePushButton->setEnabled( mTable->resizeMode() == QgsLayoutMultiFrame::UseExistingFrames );
525}
526
527void QgsLayoutManualTableWidget::mWrapBehaviorComboBox_currentIndexChanged( int index )
528{
529 if ( !mTable )
530 {
531 return;
532 }
533
534 mTable->beginCommand( tr( "Change Table Wrap Mode" ) );
535 mTable->setWrapBehavior( static_cast< QgsLayoutTable::WrapBehavior >( mWrapBehaviorComboBox->itemData( index ).toInt() ) );
536 mTable->endCommand();
537}
538
539void QgsLayoutManualTableWidget::mAdvancedCustomizationButton_clicked()
540{
541 if ( !mTable )
542 {
543 return;
544 }
545
546 QgsLayoutTableBackgroundColorsDialog d( mTable, this );
547
548 d.exec();
549}
550
551void QgsLayoutManualTableWidget::mDrawEmptyCheckBox_toggled( bool checked )
552{
553 if ( !mTable )
554 {
555 return;
556 }
557
558 mTable->beginCommand( tr( "Change Show Empty Rows" ) );
559 mTable->setShowEmptyRows( checked );
560 mTable->endCommand();
561}
562
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.