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

Qt Plugins

Qt Plugins

Postby Shando » 29 Apr 2015, 14:49

could you provide give an example of a form loading a form. Do you mean loading opening another plugin or keeping the form inside the same plugin


Basically, what I'm looking at is having a "pop-up" within the plugin.

For example, when you click on a "New" button, it opens another window that allows you to enter the info required to create the "new" whatever.

PS: thanks for the info on the resources, I'll give it a try.
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 Plugins

Postby SolarPortal » 29 Apr 2015, 14:57

i think i know what you mean lol :P
Forms that can make things like message boxes, new forms etc...

We could create a command like:
Code: Select all
qt.openPluginForm("newform.ui", 1) -- the "1" could symbolise the exec() function or "0" for show()


> the form would have to exist on the same root as the main editor.
> exec() would stop access to any other form until returned from the pop up form.

We could also add a callback to pass information back to the editor, little unsure on this, but i might be able to think of something. Or you could simply use the IO libraries to write the information to file which you could then read back in after the exec().

The other way is storing a global table using "sky.setTable()" and use "sky.getTable()" to retrieve after the exec.
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 Plugins

Postby Shando » 29 Apr 2015, 15:42

Hi SP,

Thanks for the reply.

It's not majorly important at the moment as I have changed my form a bit so I don't have to use "pop-ups".

On another note, I can't seem to get my form working as every time I try to use a "qt" function, Skyline crashes back to the desktop?? It's probably something I'm doing wrong :oops:

I've tried using this:

Code: Select all
qt.setDisabled ( thisEditor, "btnActionNew");


where I have a QPushButton called "btnActionNew", and "thisEditor" is set to the name of my form/plugin ("AI_Editor").

I've also tried a couple of the other functions, with the same result.

Any help would be greatly appreciated.

Thanks

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 Plugins

Postby SolarPortal » 29 Apr 2015, 15:55

that's strange. :shock: but we expect there to be bugs on a first time system lol :P

"thisEditor" should be the same name as the .lua, .ui and folder name of the plugin.
If you haven't already done so, you should check out the Scatter plugin.

Q) Does the scatter plugin work for you? or does that crash as well.
Q) Could you show a pic of the plugins folder with all the names showing.

I would be happy to check the plugin out for you and see if i can spot any problems and possibly fix some errors.
We are sorry for the problems you are having, but i am sure we can get them nailed if we work through them :)
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 Plugins

Postby Shando » 29 Apr 2015, 16:08

"thisEditor" should be the same name as the .lua, .ui and folder name of the plugin


Yes, all three have the same name.

The "Scatter" plugin seems to work fine (i.e. no immediate crash).

This is my folder:

Image

Could it have anything to do with the underscore??

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 Plugins

Postby SolarPortal » 29 Apr 2015, 16:14

i don't think it would have a problem with the underscore.

All we essentially do, is access a map of all editors by the editor name (AI_Editor), then grab the widget by the name.

Is there a spelling mistake on the Qt pushbutton name or in script referencing it?
This could potentially cause a crash.

This is the function from c++

Code: Select all
void CustomQtEditor_API::SetDisabled( std::string editorName, std::string objectName )
{
   customEditors.Editors[editorName]->widgets[objectName]->setEnabled(false);
}


As you can see, there are no catches yet, so a crash could be from a NULL pointer.

Are you using the "qt.setDisabled()" in the "function main()", i think this causes a crash last time i played with it.
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 Plugins

Postby Shando » 30 Apr 2015, 02:51

Hi SP,

I've managed to get it working :D I don't know what was wrong, but I think it might have been the way I was referencing the callbacks??

Unfortunately, I now have a few more questions :roll:

QUESTION 1:

Do we have to implement our own signals for each of the buttons etc.? For some reason I couldn't get my plugin to recognise a button click until I implemented a specific signal. I did notice that in the "Scatter" plugin, you have NOT referenced signals for the buttons etc., you have just created the function in the lua file.

QUESTION 2:

Could you let me know if the following functions (or similar) have been implemented:

    qt.insertTreeItem ( editor, treewidget ); INSERTS new item at END of Tree.
    qt.insertTreeItemAt ( editor, treewidget, index ); INSERTS new item at INDEX of Tree.
    qt.removeTreeItem ( editor, treewidget ); REMOVES item at END of Tree
    qt.removeTreeItemAt ( editor, treewidget, index ); REMOVES item at INDEX of Tree
    qt.insertTreeSubItem ( editor, treewidget, index ); INSERTS new sub-item at INDEX of Tree.
    qt.removeTreeSubItem ( editor, treewidget, index ); REMOVES sub-item at INDEX of Tree.
    qt.setTreeText ( editor, treewidget, index, column, text ); SETS text at INDEX and COLUMN of Tree.

    Functions as above, but for the Table Widget.

    qt.setFocus ( editor, widget ); SETS focus on widget.

WRT the Tree Widget, the INSERT & REMOVE functions could be combined by making "index" optional??

QUESTION 3:

I can't seem to set the icon of the form, even though I have referenced the .ico file in the "images" folder of the plugin?

QUESTION 4:

Do you plan on implementing a generic Skyline Stylesheet? If not, is it possible to use our own ( I would prefer a generic one as it would mean that all Plugins look roughly the same ;) )?

Sorry to be a PITA :cry:

Thanks in advance

Shando
Last edited by Shando on 30 Apr 2015, 02:54, edited 1 time in total.
Reason: Added Table Widget
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 Plugins

Postby SolarPortal » 30 Apr 2015, 10:35

your not a PITA for asking these questions, we are happy that you want to use it and are enthusiatic about it. Makes it worth developing lol :)

it's also good that you have got it working.

Like i said before, it's an early version and is missing a lot of features, but we released it as it can still create a few things :P

Question 1)
In our version, we automatically create all the signals / slots behind the scenes in c++.
So all you have to do is reference the specific callback and away you go.

For example, if you have a pushbutton called "btnButtonClick".
Then in lua create a function of that name and add "_Clicked" on the end to access its callback.

Code: Select all
function btnButtonClick_Clicked() end


Below i will show what callbacks there are for each type so far:
QLabel
no callbacks, simply set the text to this.

QPushButton / QToolButton
CheckStates = "_Toggled( state )"
Clicking = no extra words. Just use the function name with no arguments

QComboBox
"_Activated( int )" - returns the index of the combo activated
"_ActivatedText( string )" - returns the text of the combo activated
Can have icons.

QLineEdit
"_Return( stringtext )" - Called when the return key is pressed.
"_Changed( string )" - Called when the text is changed, passes the string through as an argument
"_Changed( string )" - Called when the text is edited, passes the string through as an argument
"_SelectionChanged()" - Called when the selection changes.

QTextEdit / QPlainTextEdit
"_Changed()" - Called when the text is changed, currently has no text sent through, but i will change this.
"_SelectionChanged()" - Called when the selection changes.

QDialogButtonBox
"_Accepted()" called when the ok, yes, etc.. buttons are clicked
"_Rejected()" called when the no, cancel, etc.. buttons are clicked
"_Helper()" called when the helper buttons are clicked.
Clicked callback = function name with no suffix. Argument sent is string e.g. function mydiagbox( buttonname )
returns ok, cancel, save, save as etc... This will probably change to _Clicked( text )

QDial / QSlider
"_Moved( int )" - Called when ever the slider/dial is moved.
"_Pressed()" - Called whenever the slider/dial is pressed
"_Released()" - Called whenever the slider/dial is released from pressed
"_Changed( int )" - This is the ValueChanged( int ) representative.

QKeySequenceEdit
"_Changed( value )" - called on the FinishedEditing signal.

QSpinBox
"_Changed( int )" - This is the ValueChanged( int ) representative.

QDoubleSpinBox
"_Changed( float )" - This is the ValueChanged( float ) representative.

QCheckBox / QRadioButton
"_Toggled( state )" - 1 or 0 for true or false

QToolBox
"_Changed( int )" - maps to the "currentChanged(int)" signal.

QListWidget
"_Activated( itemText, itemRow )" - maps to the itemActivated c++ command
"_Changed( itemText, itemRow )" - maps to the itemChanged c++ command
"_Clicked( itemText, itemRow )" - maps to the itemClicked c++ command
"_DoubleClicked( itemText, itemRow )" - maps to the itemDoubleClicked c++ command
"_Entered( itemText, itemRow )" - maps to the itemEntered c++ command
"_Pressed( itemText, itemRow )" - maps to the itemPressed c++ command
"_SelectionChanged()" - maps to the itemSelectionChanged c++ command

QTreeWidget
"_Activated( itemText, column, row )" - maps to the itemActivated c++ command. if top level, then row is based on top level, if sub child, index is based on childindex
"_Changed( itemText, column, row )" - maps to the itemChanged c++ command.if top level, then row is based on top level, if sub child, index is based on childindex
"_Clicked( itemText, column, row )" - maps to the itemClicked c++ command.if top level, then row is based on top level, if sub child, index is based on childindex
"_DoubleClicked( itemText, column, row )" - maps to the itemDoubleClicked c++ command.if top level, then row is based on top level, if sub child, index is based on childindex
"_Entered( itemText, column, row )" - maps to the itemEntered c++ command.if top level, then row is based on top level, if sub child, index is based on childindex
"_Pressed( itemText, column, row )" - maps to the itemPressed c++ command.if top level, then row is based on top level, if sub child, index is based on childindex
"_SelectionChanged()" - maps to the itemSelectionChanged c++ command

QMenu / QMenuBar / QToolBar
For checkstates, use the name with no suffix and pass "function actionFile( state )"
For triggered, use the name with no suffix or arguments "function actionFile()"

That is all of the ones set up for now lol :P

Question 2)
Currently there are no commands to add / remove from the tree widget, but as shown before. You can get callbacks from widgets you set up in designer.

Question 3)
i have not tried .ico files myself, :oops: perhaps try a .png and see if that fixes it. Otherwise we must be missing something as to why it isn't working

Do you plan on implementing a generic Skyline Stylesheet? If not, is it possible to use our own ( I would prefer a generic one as it would mean that all Plugins look roughly the same ;) )?

We do, it will automatically overwrite the users style if they choose that option. Since it isn't done yet, i can't say for sure the best way of dealing with it, but we have planned it. For now, just roll your own :)

I hope this clears a few things up for you :D
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 Plugins

Postby Shando » 04 May 2015, 05:56

Hi SP,

Could you let me know when you are likely to be implementing the QTableWidget & "qt.setFocus" functions??

Unfortunately, I need multiple columns in some of my "tables", and the QListWidget only allows for 1 :(

Thanks

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 Plugins

Postby SolarPortal » 04 May 2015, 10:05

in V0.9.5, QTreeWidget, QListWidget & QTableWidget have all been implemented.
The Commands are in the changelog as the API has not been updated yet. Plenty to write up.

The new example in the plugins folder shows how to use all 3. :)

Totally forgot about the "setFocus" though :oops:
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 Plugins

Postby Shando » 05 May 2015, 03:41

Hi SP,

I think I've managed to implement some Table & Tree bits now :D

One more option that appears to be missing is capturing a "QTabWidget" change?? Basically, I was hoping to use the change of Tab Index as an internal save mechanism.

Thanks

Shando

PS: my Plug-In is getting there slowly ;)

PPS: Sorry, some more requests:

1) some way to empty a combo-box/table/tree (They all have a "clear" function in Qt).
2) some way to collapse/expand a tree automatically (Qt has "collapseItem" & "expandItem").
3) info on how to populate a combo-box in code?
4) are there "getTableItemText", "getTreeItemText" etc. functions?
Last edited by Shando on 05 May 2015, 05:35, edited 2 times in total.
Reason: Added 4)
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 Plugins

Postby SolarPortal » 05 May 2015, 11:14

oh cool, its helping get the necessary functions when someone is developing with it :)
Any hint yet on what editor you are making or is it a secret for now lol ;)

One more option that appears to be missing is capturing a "QTabWidget" change?? Basically, I was hoping to use the change of Tab Index as an internal save mechanism.

Ok, makes sense. I will add this and the other features when i have some spare moments outside of my primary task.

1) some way to empty a combo-box/table/tree (They all have a "clear" function in Qt).

Yep, how could i miss this one lol :P

2) some way to collapse/expand a tree automatically (Qt has "collapseItem" & "expandItem").

This is also doable.

3) info on how to populate a combo-box in code?

There currently is no way of doing this, but i will add it :)

4) are there "getTableItemText", "getTreeItemText" etc. functions?

Not yet, again i shall add them.

I will keep you informed of when these are complete :)
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 Plugins

Postby Shando » 05 May 2015, 12:00

Hi SP,

Thanks for all of this :D

Any hint yet on what editor you are making or is it a secret for now


No secret :mrgreen:

It's a (hopefully) full editor for my AI stuff - Behaviour Trees, FSMs & Decision Trees, so it's quite a big project which I can keep working on whilst waiting for the new commands ;)

I do also have something else I'm working on, but that will remain secret for now :twisted:

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 Plugins

Postby SolarPortal » 05 May 2015, 12:04

awesome, this should be fun to use :)

Much better for a user having an interface to these large scripting sets.
V0.9.4 also allowed you to add actions to entities which means you could set up character controllers etc...
So you could generate an entire AI character from an editor from a basic mesh ;)
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 Plugins

Postby SolarPortal » 05 May 2015, 13:07

sent you a PM :)
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 Plugins

Postby Shando » 04 Jun 2015, 03:01

Hi SP,

Sorry to come back to this again, but would it be possible to implement a "pop-up" system for the plugins?

I've come across a few instances whilst building my plugins where a "pop-up" would be extremely handy (such as for warnings when saving etc.)

Thanks

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 Plugins

Postby SolarPortal » 19 Jun 2015, 16:25

yes, i shall try and fit this in for you Shando.
It shouldn't take too much work.

This will allow message boxes or extra GUI's to open. But i will make them controllable from the same lua script so variables can be used to store information without having to write to file or store in global arrays/variables.
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: Google [Bot] and 4 guests

cron