Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Hide Widget after 3 seconds with QTimer problem
Forum Updated to NodeBB v4.3 + New Features

Hide Widget after 3 seconds with QTimer problem

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.9k 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.
  • R Offline
    R Offline
    roosaw
    wrote on last edited by
    #1

    Hi I wanna hide the widget after 3 seconds (3000 miliseconds). I done something like that:
    I used variable
    @QTimer timer;@
    in class Class.
    and
    where I call function I'm doing:
    @timer.start(3000);
    button->show();
    @
    In constructor there is something like:
    @connect(timer, SIGNAL(timeout()), button, SLOT(hide()));@
    When I'm compiling it throws me an error:
    @file.cpp:34: error: no matching function for call to ‘Class::connect(QTimer&, const char [11],
    QPushButton*&, const char [8])’@
    What is all about? how to fix it? button is a pointer, timer is a variable

    1 Reply Last reply
    0
    • P Offline
      P Offline
      poporacer
      wrote on last edited by
      #2

      Try this
      @connect(&timer, SIGNAL(timeout()), button, SLOT(hide())); @

      1 Reply Last reply
      0
      • R Offline
        R Offline
        roosaw
        wrote on last edited by
        #3

        yes, it works. Thx for answer.

        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