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 QStringGrid

QStringGrid permite apresentar dados textuais em um formato tabular.
Demais componentes    - Click Barra lateral esquerda
Informações adicionais - Click propriedades  em azul
Propriedades de QStringGrid
   Campo    Tipo    R/W+    Padrão    Suporte#
 Align
 INTEGER    RW  alNone    W
 BorderStyle
 INTEGER    RW  bsSingle    
 Cell
 2D ARRAY of STRING    RW      
 Col
 INTEGER    RW      
 ColCount
 INTEGER    RW  5    
 Color
 INTEGER    RW      
 ColumnList
 ARRAY of STRING    RW      
 ColumnStyle
 ARRAY of INTEGER    RW  gcsNone    
 ColWidths 
 ARRAY of INTEGER    RW      
 Cursor
 INTEGER    RW  crDefault    W
 DefaultColWidth
 INTEGER    RW  64    
 DefaultRowHeight
 INTEGER    RW  24    
 EditorMode
 INTEGER    RW      
 Enabled
 INTEGER    RW  True    WX
 FixedColor
 INTEGER    RW      
 FixedCols
 INTEGER    RW  1    
 FixedRows
 INTEGER    RW  1    
 Font
 QFONT    W      W
 GridHeight
 INTEGER    RW      
 GridLineWidth
 INTEGER    RW  1    
 GridWidth
 INTEGER    RW      
 Handle
 INTEGER    R      
 Height
 INTEGER    RW      WX
 Hint
 STRING    RW      W
 Left
 INTEGER    RW  0    WX
 LeftCol
 INTEGER    RW      
 Parent
 QFORM/QPANEL/QTABCONTROL    W      WX
 PopupMenu
 QPOPUPMENU    W      
 Row
 INTEGER    RW      
 RowCount
 INTEGER    RW  5    
 RowHeights
 ARRAY of INTEGER    RW      
 ScrollBars
 INTEGER    RW  ssBoth    
 Separator
 STRING    RW      
 ShowHint
 INTEGER    RW  False    W
 TabOrder
 INTEGER    RW      W
 TabStops
 ARRAY of INTEGER    RW      
 Tag
 INTEGER    RW      
 Top
 ARRAY of INTEGER    RW  0    WX
 TopRow
 INTEGER    RW      
 Visible
 INTEGER    RW  True    WX
 VisibleColCount
 INTEGER    R      
 VisibleRowCount
 INTEGER    R      
 Width
 INTEGER    RW      WX
+ R = Propriedade de leitura   W = Propriedade de escrita                 # W = Windows  X = Linux
Métodos de QStringGrid
   Método    Tipo    Descrição  Parâmetros
 AddOptions
 SUBI  Adiciona opções à stringgrid.    INTEGER, Infinite
 DeleteCol
 SUB (Column%)  Deleta/Remove uma coluna.    1
 DeleteRow
 SUB (Row%)  Deleta/Remove uma coluna.    1
 DelOptions
 SUBI  Deleta opções da stringgrid.    INTEGER, Infinite
 Circle
 SUB (x1%, y1%, x2%, y2%, c%, fill%)  Desenha e preenche Círculo.    6
 CopyRect
 SUB (D, Image, S)  D e S são QRECTs, Imagem
 pode ser QImage, QCanvas, ou
 QBitmap.
   3
 Draw
 SUB (x%, y%, BMP)  Desenha Bitmap em (X,Y).    3
 FillRect
 SUB (x1%, y1%, x2%, y2%, c%)  Desenha e preenche retângulo.    5
 InsertCol
 SUB (Column%)  Insere uma coluna em branco.    1
 InsertRow
 SUB (Row%)  Insere uma linha em branco.    1
 Line
 SUB (x1%, y1%, x2%, y2%, c%)  Desenha uma linha.    5
 LoadFromFile
 SUB (File$, RowOffset%, ColOffset%, MaxRows%)  Carrega tabela de arquivo
 w/Separator.
   4
 LoadFromStream
 SUB (S AS QFileStream/QMemoryStream, RowOffset%,
 ColOffset%, MaxRows%)
 Carrega tabela de stream
 w/Separator.
   4
 Paint
 SUB (x%, y%, c%, borderc%)  Preenche Região.    4
 Pset
 SUB (x%, y%, c%)  Plota pixel.    3
 Rectangle
 SUB (x1%, y1%, x2%, Y2%, c%)  Desenha um retângulo.    5
 Repaint
 SUB  Força repintura do stringGrid.    0
 RoundRect
 SUB (x1%, y1%, x2%, y2%, x3%, y3%, c%)  Desenha e preenche um
 retângulo arredondado.
   7
 SaveToFile
 SUB (File$, RowOffset%, ColOffset%, MaxRows%)  Salva tela para rquivo
 w/Separator.
   4
 SaveToStream
 SUB (S AS QFileStream/QMemoryStream, RowOffset%, ColOffset%, MaxRows%)  Salva tabela para stream
 w/Separator.
   4
 SwapCols
 SUB (Col1%, Col2%)  Permuta duas colunas.    2
 SwapRows
 SUB (Row1%, Row2%)  Permuta duas linhas.    2
 StretchDraw
 SUB (Rect AS QRECT, BMP)  Desenha BMP e ajusta para
 caber dentro do rect.
   2
 TextHeight
 FUNCTION (Text$) AS WORD  Retorna a altura, em pixels, da
 string Text$.
   1
 TextWidth
 FUNCTION (Text$) AS WORD  Retorna a largura, em pixels,
 da string Text$.
   1
 TextRect
 SUB (Rect AS QRECT, x%, y%, S$, fc%, bc%)  Escreve texto, e clip dentro da  região de Rect.    6
 TextOut
 SUB (x%, y%, S$, fc%, bc%)  Escreve texto em célula.    5
Eventos de QStringGrid
   Evento    Tipo    Ocorre quando...    Parâmetros
 OnDrawCell
 SUB (Col%, Row%, State%,
 R AS QRect)
 Células precisam ser repintadas.    4
 OnEllipsisClick
 SUB (Col%, Row%)  A tira de pull down foi clicada.    2
 OnKeyDown
 SUB (Key AS Word, Shift
 AS INTEGER)
 Tecla pressionada.    2
 OnKeyPress
 SUB (Key AS BYTE)  Usuário pressiona uma tecla.    1
 OnKeyUp
 SUB (Key AS Word, Shift
 AS INTEGER)
 Usuário soltou uma tecla.    2
 OnListDropDown
 SUB (Col%, Row%,
 BYREF S AS STRING)
 A tira de pull down foi clicada. S é uma string com items
 separados por nova linha de caracteres.
   3
 OnSelectCell
 SUB (Col%, Row%,  CanSelect%)  Usuário selecionou uma célula.    3
 OnSetEditText
 SUB (Col%, Row%, Value$)  Usuário alterou conteúdo da célula.    3

QStrigGrid exemplos:

CREATE Form AS QForm
    CREATE Grid AS QStringGrid
        Cell(1,1) = "hello"
    END CREATE
    Center
    ShowModal
END CREATE

'------------------------------------------------------------------
' Exemplo de tira pull down

$INCLUDE "RAPIDQ.INC"
$ESCAPECHARS ON

CONST AgeList = "10\n11\n12\n13\n14\n15\n16\n17\n18\n19"

SUB EllipsisClick (Col AS LONG, Row AS LONG, Sender AS QSTRINGGRID)
    Sender.Cell(Col, Row) = "Comentários"+STR$(Row)
END SUB

CREATE Form AS QFORM
    CREATE Grid AS QSTRINGGRID
        Align = alClient
        AddOptions(goEditing)
        FixedRows = 1
        FixedCols = 0
        ColCount = 3
        RowCount = 5
        DefaultRowHeight = 20
        ColumnStyle(0) = gcsList
        ColumnStyle(1) = gcsEllipsis
        ColumnList(0) = AgeList
        Cell(0,0) = " Idade"
        Cell(1,0) = " Comentários"
        OnEllipsisClick = EllipsisClick
    END CREATE
    Caption = "Exemplo de tira Dropdown"
    Center
    ShowModal
END CREATE

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

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