anything related to UI in general, splash screens, UI widgets, input and output etc.

Qt Table Widget

Qt Table Widget

Postby Shando » 17 Jul 2015, 14:50

Hi all,

Just wondering if it is possible to get the Text entered into a Table (or Tree etc.) widget when they are set up to accept changes when the user double-clicks?

For example, I have a table that is a simple list ( I'm using the table instead of a List widget as it's easier to get the number of rows ;) ). I also have "Add Row" & "Delete Row" buttons. When you click the "Add Row" button, the new row is populated with dummy data and the user has to double-click the item in the Table to change the text. How can I now get the new text when the user hits "Enter"?

Thanks in advance, and can't wait for the next update :mrgreen:

Shando
Ryzen 7 4800H 16GB GTX1650 Win 11 64
Love, Hope, Strength http://www.lovehopestrength.co.uk
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: Qt Table Widget

Postby SolarPortal » 17 Jul 2015, 14:58

When the user presses enter, the cell data is changed.
When the cell is double clicked, this also calls through:

Can you try and use:

Code: Select all

function Nameoftablewidget_Changed( text, row, column)

end

function Nameoftablewidget_DoubleClicked( text, row, column)

end
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Qt Table Widget

Postby Shando » 17 Jul 2015, 15:08

Hi SP,

I knew it would be something simple :oops:

Code: Select all
function Nameoftablewidget_Changed( text, row, column)


works like a charm 8-)

Shando
Ryzen 7 4800H 16GB GTX1650 Win 11 64
Love, Hope, Strength http://www.lovehopestrength.co.uk
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: Qt Table Widget

Postby SolarPortal » 17 Jul 2015, 15:39

awesome :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer


Return to UI

Who is online

Users browsing this forum: No registered users and 6 guests

cron