Referência de Objetos ou componentes

Application
ClipBoard
Printer
QBitMap
QButton
QCanvas
QCheckBox
QComboBox
QComPort
QCoolBtn
QDirTree
QEdit
QFileListBox
QFileStream
QFont
QFontDialog
QForm
QGauge
QGlassFrame
QGroupBox
QHeader
QImage
QImageList
QLabel
QListBox
QListView
QMainMenu
QMemoryStream
QMenuItem
QMySQL
QNotifyIconData
QOpenDialog
QOleObject
QOleContainer
QOutLine
QOvalBtn
QPanel
QPopMenu
QRadioButton
QRect
QRegistry
QRichEdit
QSaveDialog
QScrollBar
QScrolBox
QSocket
QSplitter
QStatusBar
QStringGrid
QStringList
QTabControl
QTimer
QTrackBar
QTreeView
Componente QTimer

QTimer implementa funções de temporizador da API do Windows.
Demais componentes    - Click Barra lateral esquerda
Informações adicionais - Click propriedades  em azul
Propriedades de QTimer
   Campo    Tipo    R/W+    Padrão    Suporte#
 Enabled
 INTEGER    RW  True    WXG
 Interval
 INTEGER    RW      WXG
 Tag
 INTEGER    RW      WXG
+ R = Propriedade de leitura   W = Propriedade de escrita             #W = Windows  X = Linux  G = Solaris


Eventos de QTimer
   Evento    Tipo    Ocorre quando...    Parâmetros  Suporte#
 OnTimer
 VOID  Intervalo do temporizador transcorrido.    0    WXG
#W = Windows  X = Linux  G = Solaris



QTimer Exemplo:

' Timer & OnKeyPress exemplo para Rapid-Q por William Yu
' Se o form estiver invisivel, Timer não funcionará.

DIM Timer AS QTimer1, Timer2 AS QTimer
DIM Form AS QFORM
DIM Label1 AS QLABEL, Label2 AS QLABEL
DIM Label3 AS QLABEL

SUB TimerOver
  Timer1.Interval = 100
  I = I + 1
  Label1.Caption = STR$(I)
END SUB

SUB Timer2Over
  Timer2.Interval = 1000
  J = J + 1
  Label2.Caption = STR$(J)
END SUB

SUB KeyPressed (Key AS BYTE)     
' Evento retorna um parâmetro
  IF UCASE$(CHR$(Key)) = "Q" THEN
    FORM.CLOSE
  END IF
END SUB

I = 0      
  ' Variáveis não declaradas são automaticamente globais !
J = 0

FORM.CAPTION = "Timer Exemplo"
FORM.WIDTH = 150
FORM.HEIGHT = 120
FORM.CENTER

Label1.Parent = Form
Label1.Caption = STR$(I)
Label1.Left = FORM.WIDTH/2

Label2.Parent = Form
Label2.Caption = STR$(J)
Label2.Left = FORM.WIDTH/2
Label2.Top = 40

Label3.Parent = Form
Label3.Caption = "Pressione 'Q' para sair"
Label3.Top = 75

Timer1.Interval = 100
Timer1.Enabled = 1         
' Verdadeiro
Timer1.OnTimer = TimerOver
Timer2.Interval = 1000
Timer2.Enabled = 1         
' Verdadeiro
Timer2.OnTimer = Timer2Over

FORM.OnKeyPress = KeyPressed
FORM.SHOWMODAL

Sinta-se à vontade para dar sugestões e fazer críticas construtivas.

Anterior           Alto da página           Página Inicial             Próxima