QTableView: How to determine, if scrollbar shows up?
-
When a QTableView Instance is created dynamically according to configuration file, it seems that the scrollbar is not shown, while I still can use the mouse wheel to scroll through the table's content.
Are there any properties or similar to check, why the scrollbar does not show?
Kind regards,
Andreas
-
When a QTableView Instance is created dynamically according to configuration file, it seems that the scrollbar is not shown, while I still can use the mouse wheel to scroll through the table's content.
Are there any properties or similar to check, why the scrollbar does not show?
Kind regards,
Andreas
@andi456 said in QTableView: How to determine, if scrollbar shows up?:
When a QTableView Instance is created dynamically according to configuration file
You might show code for how you do this? I do not recall a scrollbar not being shown when it should be.
-
@andi456 said in QTableView: How to determine, if scrollbar shows up?:
When a QTableView Instance is created dynamically according to configuration file
You might show code for how you do this? I do not recall a scrollbar not being shown when it should be.
@JonB Why not? Depending on certain conditions in the config file, the following code would be used to instantiate a QTableView
tview = new QTableView(ContentWidget); tview->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
I haven't put it any layout so far. Maybe that's the problem?
-
Hi,
That's the default policy.
Please provide a minimal compilable example that shows the behaviour.
-
Hi,
That's the default policy.
Please provide a minimal compilable example that shows the behaviour.
@SGaist Ok, I'll do so, but it will take some time.
For now, maybe the following could be relevant. As the QTableView should be shown in the Tab of a QTabWidget instance, I had to create a baseWidget for the Tab and a contentWidget as its child for the QTableView instance.
Maybe I need to play around with the contentWidget or the baseWidget?
-
@SGaist Ok, I'll do so, but it will take some time.
For now, maybe the following could be relevant. As the QTableView should be shown in the Tab of a QTabWidget instance, I had to create a baseWidget for the Tab and a contentWidget as its child for the QTableView instance.
Maybe I need to play around with the contentWidget or the baseWidget?
-
@andi456 if you want to show only the QTableView in your tab, why not set it directly on it ?
-