LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-27-2017, 12:55 AM   #1
dumdadum
Member
 
Registered: May 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 14.1 64 bits
Posts: 238

Rep: Reputation: 15
Post qt refresh program through qpushbutton


Hi. I have a problem finding a way to refresh the whole program with a QPushButton. I call this through the push of the button: the clicked() slot and I use the timer just like said in the examples section of qt, on their website, the analog clock.

Code:
   connect(timer, SIGNAL(timeout()),
           this, SLOT(update()));
   connect(buttonNow, SIGNAL(clicked()),
           this, SLOT(setNowClicked()));
Anybody can help me out??
Cheers,
Dumdadum

Last edited by dumdadum; 09-27-2017 at 03:35 AM.
 
Old 09-27-2017, 03:34 AM   #2
dumdadum
Member
 
Registered: May 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 14.1 64 bits
Posts: 238

Original Poster
Rep: Reputation: 15
segmentation fault

Here is what I tried...

Code:
connect(timer, SIGNAL(timeout()),
this, SLOT(setNowClicked()));
I placed the name of the slot I created instead of update cuz update wouldnt work I dont know why...
The program refreshes, wont even ask for a button click, which is odd, and then, boom, segmentation fault every time. The timer is set to 1000, so one second. Is it possible that in between refresh theres too many calculations and so it cant commit?

Anybody can help?
Dumdadum

Last edited by dumdadum; 09-27-2017 at 04:06 AM.
 
Old 09-27-2017, 11:08 AM   #3
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 675

Rep: Reputation: 255Reputation: 255Reputation: 255
Need to see some more code in order to help.

Please post at least your main widget constructor and setNowClicked().
 
Old 09-27-2017, 02:48 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,482
Blog Entries: 6

Rep: Reputation: 2413Reputation: 2413Reputation: 2413Reputation: 2413Reputation: 2413Reputation: 2413Reputation: 2413Reputation: 2413Reputation: 2413Reputation: 2413Reputation: 2413
Please see the Site FAQ, and this link from that page, for guidance in asking well formed and complete questions.

As asked, your question does not provided enough information for anyone to provide help. Please try to reduce the problem to s simplest complete code example which demonstrates the problem so that we can see what is happening.

You have also referenced an example on the qt website, but did not provide a link. Please be respectful of the time others contribute and provide a link to the example so that others may quickly find it for reference.
 
Old 09-27-2017, 04:44 PM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,567

Rep: Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923
Just post your full code.
 
Old 09-27-2017, 06:21 PM   #6
dumdadum
Member
 
Registered: May 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 14.1 64 bits
Posts: 238

Original Poster
Rep: Reputation: 15
Question

Quote:
Originally Posted by norobro View Post
Need to see some more code in order to help.

Please post at least your main widget constructor and setNowClicked().
I played with the timer->start(1); line and it segmentation faults right away. Not enough time to calculate. Mathematics...

Thanks for the help.
Dumdadum
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use web to invoke php program, and the php program call c program bellhuang Linux - Server 10 01-13-2014 06:09 AM
refresh hesam_ocean Linux - Desktop 2 05-20-2009 04:16 AM
Audio works on one program at a time, internet video bad refresh rate Eredeath Linux - Hardware 1 08-23-2008 06:37 PM
Folder refresh. Where can I change how often the refresh occurs? glore2002 Slackware 2 08-12-2008 12:37 AM
refresh toma Linux - General 17 08-08-2001 10:15 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration