Skip to content

Conversation

@KRTirtho
Copy link
Contributor

@KRTirtho KRTirtho commented Apr 6, 2021

Fixes #269

Added New Components:

  • Table (inherits QTableWidget)
  • TableItem (inherits QTableWidgetItem)
  • ErrorPrompt (inherits QErrorMessage)

Guidelines about Table are documented as comments & example are also shown via doc strings

Example (Table & TableItem):

function TableExample(){
return (
    <Table
          cellRange={{ row: 2, column: 2 }} // 2 x 2 = 4 cells total
          style="flex: 1;"
          horizontalHeaderLabels={["What", "How", "When"]}
          verticalHeaderLabels={["yes", "this", "later"]}
          hideRows={[0]} //hides the very first row
          hideColumns={[1]} //hides the second column
        >
          <TableItem cellPosition={[0, 0]} text="1" toolTip="Tooltip"/>
          <TableItem cellPosition={[0, 1]} text="2"/>
          <TableItem cellPosition={[1, 0]} text="3"/>
          <TableItem 
             cellPosition={[1, 1]} // position tuple [row, column]
             text="4"
             //makes the table item non-editable, non-selectable & only checkable
             //Focus on the "Bitwise OR (|)" operator
             flags={ItemFlag.ItemIsEnabled | ItemFlag.ItemIsUserCheckable} 
          />
      </Table>
  )
}

Also added warnings if wrong index was supplied for any row/column related prop

QErrorMessage is also a kind of dialog but for name I couldn't understand its a Dialog. The React wrapper for this is called ErrorPrompt. This one works same as Dialog | FileDialog | ColorDialog etc..
Works only if was wrapped/added as a child of View | BoxView just like all other Dialogs

Thanks @a7ul

@a7ul
Copy link
Collaborator

a7ul commented Apr 6, 2021

Thank you @KRTirtho

@a7ul a7ul merged commit f0feda0 into nodegui:master Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

react-nodegui add QTableWidget?

2 participants