Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-13768

QSplitter - Not possible to change hovered handle color through a CSS rule

    XMLWordPrintable

Details

    Description

      The hover flag is never set in QSplitterHandle because QSplitterHandle does not receive hover events.

      Test case:

      
      #include <QApplication>
      #include <QSplitter>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QSplitter splitter(Qt::Horizontal);
          splitter.addWidget(new QTextEdit("hello 1"));
          splitter.addWidget(new QTextEdit("hello 2"));
          splitter.addWidget(new QTextEdit("hello 3"));
          splitter.setStyleSheet("QSplitter::handle:horizontal:hover {background-color:red;}");
          splitter.show();
          return a.exec();
      }
      
      

      Workaround to activate the hover on the QSplitterHandle

      
      splitter.setStyleSheet("QSplitterHandle:hover {}  QSplitter::handle:horizontal:hover {background-color:red;}");
      
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes