Results 1 to 2 of 2

Thread: Error when playing exercises

  1. #1
    Join Date
    Sep 2013
    Posts
    4
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Error when playing exercises

    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 

  2. #2
    Join Date
    Dec 2012
    Posts
    197
    Thanks
    25
    Thanked 41 Times in 33 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Error when playing exercises

    Hello,
    just look at the link you sent its not the same code... Syntax Errors.
    you missed a couple of ; and you added he by mistake etc... fix the errors.
    is it your first day of programming ?
    good luck.

Similar Threads

  1. Playing video in Qt.
    By SiddhantR in forum Newbie
    Replies: 1
    Last Post: 22nd July 2013, 14:20
  2. Qsound Error while playing Audio
    By augusbas in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 1st February 2010, 11:20
  3. Answers for Exercises:
    By maverick_pol in forum General Programming
    Replies: 0
    Last Post: 18th February 2009, 10:38
  4. Some exercises?
    By phy51km4n in forum Newbie
    Replies: 2
    Last Post: 13th June 2008, 18:50
  5. Playing movies
    By yellowmat in forum Newbie
    Replies: 5
    Last Post: 29th March 2006, 14:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.