Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Using QTimeline to bink textedit box instead (Solved)
Forum Updated to NodeBB v4.3 + New Features

Using QTimeline to bink textedit box instead (Solved)

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    houmingc
    wrote on 25 Sept 2014, 15:39 last edited by
    #1

    Below is my code using Qtimer, i like to get a sample code for using Qtimeline, please kindly assist.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      houmingc
      wrote on 25 Sept 2014, 15:41 last edited by
      #2

      QTimer *timer = new QTimer(this);

      connect(timer, SIGNAL(timeout()), this, SLOT(update()));

      timer->start(1000);
      textlabel=color1;

      void blinkme()
      {
      if(textlabel = color1)
      textlabel->clear
      else textlabel->color1
      update();
      }

      1 Reply Last reply
      0
      • H Offline
        H Offline
        houmingc
        wrote on 25 Sept 2014, 15:52 last edited by
        #3

        how to delete post

        1 Reply Last reply
        0
        • H Offline
          H Offline
          houmingc
          wrote on 25 Sept 2014, 15:55 last edited by
          #4

          QColor red;
          QColor green;
          int mybuttonState;
          connect(timer, SIGNAL(timeout),this, SLOT(Changecolor));
          mybuttonState=1;

          Changecolor()
          {
          mybuttonState= ++mybuttonState;
          if(++mybuttonState%2 ==0)
          txtlabel->red
          else txtlabel->green;
          }

          mybuttonState is initially set as 1, when slot activates, mybuttonState adds 1 and if division remainder result in 0 txtlabel is red else green.
          Thus label blinks 1sec red, green. Using Qtimeline?

          1 Reply Last reply
          0
          • H Offline
            H Offline
            houmingc
            wrote on 30 Sept 2014, 02:07 last edited by
            #5

            I successfully implemented one basic timer. Below is workable code.
            My problem is when i implemented three basic timer. do i need 3 timerEvent??? The document in the net is not comprehensive enough. Does 3 timer use 3 timer handler or just one time handler?

            #include <QBasicTimer>

            MainWindow::MainWindow
            { ui->setupui(this);
            step1=3;
            timer1.start(600, this);
            }

            MainWindow::timerEvent1( QTimerEvent *event )
            { if( event->timerid() == timer1.timerid() )
            { update();
            } else
            { MainWindow::timerEvent1(event);
            }
            }

            MainWindow::Update()
            { if(set1%2)
            { ui->label->setText("hello");
            step1--;
            } else
            { ui->label->setText("GoodBye");
            step1++;
            }
            }

            1 Reply Last reply
            0
            • H Offline
              H Offline
              houmingc
              wrote on 30 Sept 2014, 02:08 last edited by
              #6

              I successfully implemented one basic timer. Below is workable code.
              My problem is when i implemented three basic timer. do i need 3 timerEvent??? The document in the net is not comprehensive enough. Does 3 timer use 3 timer handler or just one time handler?

              #include <QBasicTimer>

              MainWindow::MainWindow
              { ui->setupui(this);
              step1=3;
              timer1.start(600, this);
              }

              MainWindow::timerEvent1( QTimerEvent *event )
              { if( event->timerid() == timer1.timerid() )
              { update();
              } else
              { MainWindow::timerEvent1(event);
              }
              }

              MainWindow::Update()
              { if(set1%2)
              { ui->label->setText("hello");
              step1--;
              } else
              { ui->label->setText("GoodBye");
              step1++;
              }
              }

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sasireka
                wrote on 30 Sept 2014, 04:30 last edited by
                #7

                good. Do you have any idea by changing image using keypress.

                .................................
                Thanks & Regards

                Sasi

                .................................
                Go Green

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  houmingc
                  wrote on 1 Nov 2014, 15:32 last edited by
                  #8

                  how to make pushbutton blink instead. I fail to do it after my vacation.
                  I forget everything.

                  Timer3update()
                  {
                  ui->PBleftdoorOpen->setvisible(1);
                  timer3step - -;
                  }
                  else
                  {
                  ui->PBrightdoorOpen->setvisible(0);
                  timer3step++;
                  }

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved