I want to resize a dialog to the width of a QTableView inside of it....
Unsolved
General and Desktop
-
wrote on 22 Mar 2024, 20:33 last edited by
I tried this:
QSize sizeOfTableView = tableView->size(); QSize sizeOfWindow = this->size(); resize(sizeOfTableView.width(), sizeOfWindow.height());
it does not work as expected!
-
I tried this:
QSize sizeOfTableView = tableView->size(); QSize sizeOfWindow = this->size(); resize(sizeOfTableView.width(), sizeOfWindow.height());
it does not work as expected!
-
I tried this:
QSize sizeOfTableView = tableView->size(); QSize sizeOfWindow = this->size(); resize(sizeOfTableView.width(), sizeOfWindow.height());
it does not work as expected!
-
@jdent
Show us a screenshot of what you get.As I said earlier, the sizes of the inner widgets are valid once the dialog is shown.
-
@mpergand ok, how can I capture the moment a dialog is shown??
In MFC there was a OnInitDialog() method.... nothing similar here? There must be a signal to trap...
wrote on 22 Mar 2024, 21:38 last edited by@jdent said in I want to resize a dialog to the width of a QTableView inside of it....:
how can I capture the moment a dialog is shown??
What's your use case ?
-
@mpergand ok, how can I capture the moment a dialog is shown??
In MFC there was a OnInitDialog() method.... nothing similar here? There must be a signal to trap...
wrote on 22 Mar 2024, 22:09 last edited by
3/6