Guys,
I'm trying to reproduce this example:

http://www.codeprogress.com/cpp/libr...ectHeaderClick

I'm using QT5, only returns me the error:

/home/will/Qt - Projetos/Telas/Variaveis.h:15: error: 'setClickable' was not declared in this scope

My current class is as follows:

Qt Code:
  1. #include <QMessageBox>
  2. #include <QHeaderView>
  3. #include <iostream>
  4. #include <QtGui>
  5.  
  6. class myHeaderView : public QHeaderView
  7. {
  8. Q_OBJECT
  9. public:
  10. myHeaderView():QHeaderView(Qt::Horizontal)
  11. {
  12. he
  13. setClickable(true);
  14. connect(this,SIGNAL(sectionClicked(int)),this,SLOT(sectionClicked(int)));
  15. }
  16. ~myHeaderView(){}
  17.  
  18. public slots:
  19. void sectionClicked(int index)
  20. {
  21. QMessageBox::about(this,"Hi! Header Click Detected!","Index:"+QString::number(index));
  22. }
  23.  
  24. };
To copy to clipboard, switch view to plain text mode