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

ValueChanged() signal is not emitted by QScrollBar when Page Up/Dn is Hit in QPlainTextEdit having scrollbar

    XMLWordPrintable

Details

    • All, macOS
    • 8b8437489 (dev), 90a16c3f7 (6.4), 20e280ddb (6.5), 09c3cd850 (dev), 3282d501e (tqtc/lts-6.2), 9dea40363 (6.5), 2c4fac4a3 (6.4), 52f8fd2e6 (tqtc/lts-6.2)

    Description

      QScrollBar in QPlainTextEdit does not emit signal in all the cases. If Page Up/Dn is hit or mouse is clicked in the scrollbar's gutter region.

      Following example demonstrate the issue if hit page up/dn key or click the mouse in region.

      #include <QtGui>
      
      class myPlainTextEdit:public QPlainTextEdit
      {
      	Q_OBJECT
      public:
      	myPlainTextEdit(QWidget *parent=0)
      	{
      		QString s;
            for (int i=0; i<1000; i++)
      		  s += QString("Line #%1\n").arg(i);
      	  
           setPlainText(s);
      	 connect(verticalScrollBar(),SIGNAL(valueChanged(int)),this,SLOT(myScrollBarSlot(int)));
      	
      	}
      
      	public slots:
      		void myScrollBarSlot(int value)
      		{
      			qDebug()<<"changed value ="<<value;
      		}
      };
      
      #include "main.moc"
      int main(int argc, char ** argv)
      {
         QApplication app(argc, argv);
         myPlainTextEdit w;
         w.show();
         return app.exec();
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              axelspoerl Axel Spoerl
              irfan.omair@gmail.com irfan B omair
              Votes:
              5 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: