Page 1 of 5 123 ... LastLast
Results 1 to 10 of 41

Thread: More QT Creator Questions

  1. #1
    Join Date
    Mar 2002
    Location
    Colorado
    Posts
    255

    Default More QT Creator Questions

    I'm slowly getting my NetRemote converted to QT and have some questions:

    1. Is there any way to create pages with buttons and text that can be resized? I want to toggle the window between full screen and a windowed screen, but I would like the buttons and text to resize with it like NetRemote does. It looks like your mce example keeps the images and text the same size when the screen is resized. I suppose I could create a 2nd QT file with size of the buttons and text reduced for the windowed version but that leads to my 2nd question.....

    2. How can I call a different QT page from Girder? (it might be in the examples, but I can't figure it out).

    3. How can I change the look of a QT button from Girder? I have some buttons that I want to have changed to a 3rd state (up, pressed, highlighted) by Girder.

    Thanks,
    John

  2. #2
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    1. You can use Anchor based layouts to scale with the size of the window. (http://qt-project.org/doc/qt-5.1/qtq...g-anchors.html), alternatively you can use Layouts (http://qt-project.org/doc/qt-5.1/qtq...uts-index.html)

    2. You mean display a different page in the QML window from a Girder Action? If so this is a two step answer.

    a. use girder.setUrl( urlToPageToDisplay ); can be used inside a QML file to load a new page. (Alternatively you could load multiple QML pages inside a master QML page and toggle visibility)

    b. inside Girder use the Key Value store to send data and events to QML. The manual has some examples for the Lua side. And the UI directory has a file called kvExample.qml to show how key value stores are used.

    3. Change look of a button can be done using QML states (https://qt-project.org/doc/qt-5.0/qt...ns-states.html) the use the Key Value store tied to the state setting of your button to trigger the various states.

    Let me know if this gets you going or if you get stuck anywhere.
    Ron
    No support through PM

  3. #3
    Join Date
    Mar 2002
    Location
    Colorado
    Posts
    255

    Default

    Thanks Ron - I'll check it out.

  4. #4
    Join Date
    Mar 2002
    Location
    Colorado
    Posts
    255

    Default

    OK, I've played around with this a little more and have more questions:
    1 & 2. I think it will be easier to make 2 different pages - one with buttons scaled for full screen (named FullScreen) and one for windowed (named Windowed) and toggle the look by pressing a button. I can't figure out the correct syntax of girder.setUrl( urlToPageToDisplay );. I've tried:
    onClicked: {
    girder.setUrl( Windowed );
    but it doesn't work.
    3. I'm basing my pages on your events.qml example with Button.qml. Do I need to specify the other look in the Button.qml file and call that state in the events.qml or is everything done in the events.qml file?
    Thanks,
    John

  5. #5
    Join Date
    Mar 2002
    Location
    Colorado
    Posts
    255

    Default

    Any suggestions?

  6. #6
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    for the setUrl call try "file:///C:/Devel/G6_Builds/src/girder/ui/dm/dm.qml" adjust to your path and filename.

    You can change the state of the button in the button.qml or from your main qml file.
    Ron
    No support through PM

  7. #7
    Join Date
    Mar 2002
    Location
    Colorado
    Posts
    255

    Default

    I'm still stuck changing the state of the button. I'm using the Button.qml and have created my own button.png and button_pressed.png. I have a 3rd image (button_selected.png) that I would like to change an individual button to under certain conditions. It seems that it would work to use states to change the image using PropertyChanges, but I don't get the syntax to make that work. Any suggestions? Thanks

  8. #8
    Join Date
    Mar 2002
    Location
    Colorado
    Posts
    255

    Default

    Any suggestions?

  9. #9
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    I'm sure you saw this:

    https://qt-project.org/doc/qt-4.8/qm...tychanges.html

    In that case upload your QMLs so I can have a look.
    Ron
    No support through PM

  10. #10
    Join Date
    Mar 2002
    Location
    Colorado
    Posts
    255

    Default

    I saw that, but couldn't come up with the syntax to use to change the button image.

Page 1 of 5 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •