June 14, 2012

pragati pragati
Ant Farmer
116 posts

QKinecticScroller

 

Hi all,

I followed exactly as explained in this link
http://qt-project.org/forums/viewthread/4059

Used the same qskinecticscroller.h and .cpp files but still my code is working not I am not able to scroll it……Is there any changes I have to make in the qskinecticscroller files?

here is my .h file

  1. #ifndef CURRENT_H
  2. #define CURRENT_H
  3. #include <QtGui>
  4. #include <QWidget>
  5.  
  6. namespace DMM {
  7. class DMMMenu;
  8. }
  9.  
  10. namespace DMM {
  11.  
  12. namespace Ui {
  13.  
  14. class Current;
  15.  
  16. }
  17.  
  18. class Current: public QWidget
  19.  
  20. {
  21.     Q_OBJECT
  22.  
  23. public :
  24.  
  25.     Current(QWidget *parent = 0);
  26.     ~Current();
  27.  
  28. public slots:
  29.     void On_homeButton_clicked();
  30.  
  31. public:
  32. DMM::DMMMenu *current_home;
  33. DMM::Current *current;
  34. private:
  35.  
  36. DMM::Ui::Current *ui;
  37.  
  38. };
  39.  
  40. }
  41.  
  42. #endif // CURRENT_H

here is the.cpp file:

  1. #include "../../DMM/Include/Current.h"
  2. #include "../../DMM/Include/Scroll.h"
  3. #include "ui_Current.h"
  4. #include <QDateTime>
  5. #include <QComboBox>
  6. #include <QScrollArea>
  7. #include <QScrollBar>
  8.  
  9. namespace DMM {
  10.  
  11. Current::Current(QWidget *parent) :
  12.     QWidget(parent),
  13.  
  14.     ui(new Ui::Current)
  15.  
  16. {
  17.     ui->setupUi(this);
  18.   Scroll *scroller = new Scroll(this);
  19.         scroller->enableKineticScrollFor(ui->scrollArea);
  20.  
  21.  
  22.     connect(ui->homeButton, SIGNAL(clicked()), this, SLOT(On_homeButton_clicked()));
  23.  
  24.  
  25.  
  26. //    //    get current date
  27. //    QDate date = QDate::currentDate();
  28. //    QString dateString = date.toString();
  29. //    ui->label_date->setText(dateString);
  30.  
  31. //    //   get current time
  32. //    QTime time = QTime::currentTime();
  33. //    QString timeString = time.toString();
  34. //    ui->label_time->setText(timeString);
  35.  
  36.     //  CurrentRatio
  37.     ui->comboBox->addItem("1:1");
  38.     ui->comboBox->addItem("1:10");
  39.     ui->comboBox->addItem("1:100");
  40.     ui->comboBox->addItem("1:1000");
  41.  
  42.  
  43. }
  44.  
  45. void Current::On_homeButton_clicked()
  46. {
  47.     current_home->show();
  48.     this->close();
  49.  
  50. }
  51.  
  52. Current::~Current()
  53. {
  54.  
  55. }

You can find the kinecticscrollers.h and .cpp files in the described link…I am not able to paste here as it was too long….

But there is no changes made in these two files.

Please Help!!!

Thanks,
Pragati

1 reply

June 26, 2012

Andre Andre
Area 51 Engineer
6031 posts

Please see this post.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

 
  ‹‹ [Solved]QButtonBox translation      QScriptEnging::evaluate() returning value ››

You must log in to post a reply. Not a member yet? Register here!