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