Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Splitter resize icon not shown

    General and Desktop
    4
    15
    253
    Loading More Posts
    • 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.
    • L
      leinad last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • Christian Ehrlicher
        Christian Ehrlicher Lifetime Qt Champion last edited by

        Please provide a minimal example. Don't know what splitters should have to do with a QTreeView.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply Reply Quote 0
        • L
          leinad last edited by

          Not sure how to write an example, the splitters and treeViews are built with Qtcreator. I just added a line in MainWindow to force the horizontal scroll to scrollPerItem. If I comment that out, I see the icon.

          1 Reply Last reply Reply Quote 0
          • Christian Ehrlicher
            Christian Ehrlicher Lifetime Qt Champion last edited by

            So you don't mean a QSplitter but the change of the mouse cursor when you want to resize the sections?

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply Reply Quote 0
            • L
              leinad last edited by

              Yes, that is correct.

              1 Reply Last reply Reply Quote 0
              • Christian Ehrlicher
                Christian Ehrlicher Lifetime Qt Champion last edited by

                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.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply Reply Quote 0
                • VRonin
                  VRonin last edited by

                  Are you applying a stylesheet?

                  "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                  ~Napoleon Bonaparte

                  On a crusade to banish setIndexWidget() from the holy land of Qt

                  1 Reply Last reply Reply Quote 0
                  • L
                    leinad last edited by

                    No stylesheet. I did another test and commented out the line above and still no icon. So now it has nothing to do with that code, just for some reason that icon does not appear. Very strange. Is there some code I can write to force it?

                    1 Reply Last reply Reply Quote 0
                    • Christian Ehrlicher
                      Christian Ehrlicher Lifetime Qt Champion last edited by

                      Again: write a simple testcase to try to reproduce it.

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      1 Reply Last reply Reply Quote 0
                      • L
                        leinad last edited by

                        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 spinner

                        This code does not effect the resize icon:
                        this->setCursor(Qt::WaitCursor);
                        this->setCursor(Qt::ArrowCursor);

                        Why would the setOverideCursor cause such a behavior?

                        1 Reply Last reply Reply Quote 0
                        • L
                          leinad last edited by

                          In case someone ask the next logical question "why use the setOverrideCursor?" It is because sometimes the setCursor did not display the wait cursor as I expected where as the alternate did, but apparently it causes other issues :(

                          1 Reply Last reply Reply Quote 0
                          • SGaist
                            SGaist Lifetime Qt Champion last edited by

                            Hi,

                            Because you did not call restoreOverrideCursor once done with the code that required setOverrideCursor in the first place.

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply Reply Quote 2
                            • L
                              leinad last edited by

                              Well, I went back through all the code and did fine to starts which occurred back to back. So I modified the code to have a single start and right after a single end but still the same issue. I even tried using restoreOverrideCursor but still no good.

                              1 Reply Last reply Reply Quote 0
                              • L
                                leinad last edited by

                                This seems to work but not sure if it is the correct way.
                                startCursor()
                                {
                                QApplication::setOverrideCursor(Qt::WaitCursor);

                                }

                                1 Reply Last reply Reply Quote 0
                                • L
                                  leinad last edited by

                                  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();
                                  }

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post