qt - Handling mouseevent in QStatusBar -


In my status prompt, I added a QLabel inside which I am displaying some message . Now what do I want to do when I click on that code in QLabel ( QStatusBar ), the message should be missing.

The added status is added to the following:

  QLabel * cpyrightlbl = new QLabel (); Ui.statusBar-> AddWidget (cpyrightlbl); Cpyrightlbl- & gt; Set text ("demo message"); Cpyrightlbl- & gt; Set stylesheet ("border: 3px"); Cpyrightlbl- & gt; SetFixedWidth (.frameGameometry () width ()); Cpyrightlbl- & gt; Show (); You should create your own category from  QLabel  And then the function  QLabel :: mousePressEvent (QMouseEvent * ev) .  
  Repeat the zero CMyLabel :: mousePressEvent (QMouseEvent * ev) function {if (& gt; Button) == QT :: LeftButton} {This-> clear (); // or // it- & gt; Set text (""); } QLabel :: Mousepress Event (Eve); }   


Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -