Bitcoin Core  21.99.0
P2P Digital Currency
Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
GUIUtil::TableViewLastColumnResizingFixer Class Reference

Makes a QTableView last column feel as if it was being resized from its left border. More...

#include <guiutil.h>

Inheritance diagram for GUIUtil::TableViewLastColumnResizingFixer:
[legend]
Collaboration diagram for GUIUtil::TableViewLastColumnResizingFixer:
[legend]

Public Member Functions

 TableViewLastColumnResizingFixer (QTableView *table, int lastColMinimumWidth, int allColsMinimumWidth, QObject *parent)
 Initializes all internal variables and prepares the the resize modes of the last 2 columns of the table and. More...
 
void stretchColumnWidth (int column)
 

Private Slots

void on_sectionResized (int logicalIndex, int oldSize, int newSize)
 
void on_geometriesChanged ()
 

Private Member Functions

void adjustTableColumnsWidth ()
 
int getAvailableWidthForColumn (int column)
 
int getColumnsWidth ()
 
void connectViewHeadersSignals ()
 
void disconnectViewHeadersSignals ()
 
void setViewHeaderResizeMode (int logicalIndex, QHeaderView::ResizeMode resizeMode)
 
void resizeColumn (int nColumnIndex, int width)
 

Private Attributes

QTableView * tableView
 
int lastColumnMinimumWidth
 
int allColumnsMinimumWidth
 
int lastColumnIndex
 
int columnCount
 
int secondToLastColumnIndex
 

Detailed Description

Makes a QTableView last column feel as if it was being resized from its left border.

Also makes sure the column widths are never larger than the table's viewport. In Qt, all columns are resizable from the right, but it's not intuitive resizing the last column from the right. Usually our second to last columns behave as if stretched, and when on stretch mode, columns aren't resizable interactively or programmatically.

This helper object takes care of this issue.

Definition at line 194 of file guiutil.h.

Constructor & Destructor Documentation

◆ TableViewLastColumnResizingFixer()

GUIUtil::TableViewLastColumnResizingFixer::TableViewLastColumnResizingFixer ( QTableView *  table,
int  lastColMinimumWidth,
int  allColsMinimumWidth,
QObject *  parent 
)

Initializes all internal variables and prepares the the resize modes of the last 2 columns of the table and.

Definition at line 573 of file guiutil.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ adjustTableColumnsWidth()

void GUIUtil::TableViewLastColumnResizingFixer::adjustTableColumnsWidth ( )
private

Definition at line 524 of file guiutil.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectViewHeadersSignals()

void GUIUtil::TableViewLastColumnResizingFixer::connectViewHeadersSignals ( )
private

Definition at line 473 of file guiutil.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ disconnectViewHeadersSignals()

void GUIUtil::TableViewLastColumnResizingFixer::disconnectViewHeadersSignals ( )
private

Definition at line 480 of file guiutil.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAvailableWidthForColumn()

int GUIUtil::TableViewLastColumnResizingFixer::getAvailableWidthForColumn ( int  column)
private

Definition at line 509 of file guiutil.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getColumnsWidth()

int GUIUtil::TableViewLastColumnResizingFixer::getColumnsWidth ( )
private

Definition at line 499 of file guiutil.cpp.

Here is the caller graph for this function:

◆ on_geometriesChanged

void GUIUtil::TableViewLastColumnResizingFixer::on_geometriesChanged ( )
privateslot

Definition at line 559 of file guiutil.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_sectionResized

void GUIUtil::TableViewLastColumnResizingFixer::on_sectionResized ( int  logicalIndex,
int  oldSize,
int  newSize 
)
privateslot

Definition at line 547 of file guiutil.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resizeColumn()

void GUIUtil::TableViewLastColumnResizingFixer::resizeColumn ( int  nColumnIndex,
int  width 
)
private

Definition at line 493 of file guiutil.cpp.

Here is the caller graph for this function:

◆ setViewHeaderResizeMode()

void GUIUtil::TableViewLastColumnResizingFixer::setViewHeaderResizeMode ( int  logicalIndex,
QHeaderView::ResizeMode  resizeMode 
)
private

Definition at line 488 of file guiutil.cpp.

Here is the caller graph for this function:

◆ stretchColumnWidth()

void GUIUtil::TableViewLastColumnResizingFixer::stretchColumnWidth ( int  column)

Definition at line 539 of file guiutil.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ allColumnsMinimumWidth

int GUIUtil::TableViewLastColumnResizingFixer::allColumnsMinimumWidth
private

Definition at line 205 of file guiutil.h.

◆ columnCount

int GUIUtil::TableViewLastColumnResizingFixer::columnCount
private

Definition at line 207 of file guiutil.h.

◆ lastColumnIndex

int GUIUtil::TableViewLastColumnResizingFixer::lastColumnIndex
private

Definition at line 206 of file guiutil.h.

◆ lastColumnMinimumWidth

int GUIUtil::TableViewLastColumnResizingFixer::lastColumnMinimumWidth
private

Definition at line 204 of file guiutil.h.

◆ secondToLastColumnIndex

int GUIUtil::TableViewLastColumnResizingFixer::secondToLastColumnIndex
private

Definition at line 208 of file guiutil.h.

◆ tableView

QTableView* GUIUtil::TableViewLastColumnResizingFixer::tableView
private

Definition at line 203 of file guiutil.h.


The documentation for this class was generated from the following files: