Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Track QHeaderView geometry

Track QHeaderView geometry

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 889 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Daylight
    wrote on last edited by
    #1

    I'm trying to adjust a margin of a layout depending on the width of QHeadeView. There is a QHeadeView::geometriesChanged() signal, which expected signals any header geometry changes. However debug shows that this signal is not emitted, when the corresponding model is reset, for example. If a call my slot manually - the margin is updated correctly, but any changes in underlying QAbstractTableModel are ignored.
    Is there any other way to achieve what I want?
    @
    MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
    {
    //...
    connect(ui->tradeTableView->verticalHeader(),
    &QHeaderView::geometriesChanged, = {
    int width=this->ui->tradeTableView->verticalHeader()->width();
    this->ui->tradeFiltersHorizontalLayout->setContentsMargins(width,0,0,0);
    } );
    }
    @
    wrong:
    !https://farm4.staticflickr.com/3897/14618950274_9146ea1f02_z.jpg(wrong)!
    correct:
    !https://farm4.staticflickr.com/3883/14434426158_057906a2a6_z.jpg(correct)!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved