mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
3ae378d9b9
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4067 b45a01b8-16f6-495d-af2f-9b41ad6348cc
42 lines
896 B
C++
42 lines
896 B
C++
#pragma once
|
|
|
|
#include <QApplication>
|
|
#include <QWidget>
|
|
#include "mainpage.h"
|
|
|
|
// This class implement a basic RS functionality which is that widgets displayign info
|
|
// should update regularly. They also should update only when visible, to save CPU time.
|
|
//
|
|
// Using this class simply needs to derive your widget from RsAutoUpdateWidget
|
|
// and oveload the update() function with the actual code that updates the
|
|
// widget.
|
|
//
|
|
class QTimer ;
|
|
|
|
class RsAutoUpdatePage: public MainPage
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
RsAutoUpdatePage(int ms_update_period = 1000,QWidget *parent=NULL) ;
|
|
virtual ~RsAutoUpdatePage() ;
|
|
|
|
virtual void updateDisplay() {}
|
|
|
|
static void lockAllEvents() ;
|
|
static void unlockAllEvents() ;
|
|
static bool eventsLocked() ;
|
|
|
|
protected:
|
|
virtual void showEvent(QShowEvent *e) ;
|
|
|
|
private slots:
|
|
void timerUpdate() ;
|
|
|
|
private:
|
|
QTimer *_timer ;
|
|
|
|
static bool _locked ;
|
|
};
|
|
|