Splitter resize icon not shown
-
Hi,
I have a GUI that uses several splitters. When I put my mouse over the splitter, I get this small icon with double parallel lines and arrows pointing in opposite direction which tells the user the way the splitters can be moved out or in which is perfect. However when I use this command to force the horizontal scroll to scroll per item:
treeView->setHorizontalScrollMode(QTreeView::ScrollPerItem); //stay at latest column
the little icon I described above goes away. I can still resize everything but there is no icon so it is not obvious to the user on how they can expand or reduce the size of the view.
Can someone explain to me why this is the case and how I can get my resize icon back?
Thanks again.
-
Please provide a minimal example. Don't know what splitters should have to do with a QTreeView.
-
So you don't mean a QSplitter but the change of the mouse cursor when you want to resize the sections?
-
A quick check in designer preview I don't see such a behavior. Please write a small testcase to see if it really does not work on your system.
-
Again: write a simple testcase to try to reproduce it.
-
Okay I figured out the problem but not sure why this would cause it. The problem has to do with starting and stopping the cursor;
This statement removes the resize icon from the splitter if I use it: All is in MainWindow.
QApplication::setOverrideCursor(Qt::WaitCursor); //shows wait spinner
QApplication::setOverrideCursor(Qt::ArrowCursor); //end wait spinnerThis code does not effect the resize icon:
this->setCursor(Qt::WaitCursor);
this->setCursor(Qt::ArrowCursor);Why would the setOverideCursor cause such a behavior?
-
Hi,
Because you did not call restoreOverrideCursor once done with the code that required setOverrideCursor in the first place.
-
-
Sorry for some reason the screen reset so I'll try again: This seems to work. Does it make sense?
startCursor()
{
QApplication::setOverrideCursor(Qt::WaitCursor);
}endCursor()
{
QApplication::restoreOverrideCursor();
QApplication::setOverrideCursor(Qt::ArrowCursor);
QApplication::restoreOverrideCursor();
}