Forums

OverviewV-Play 2 Support (Qt 5) › Dialog cannot be resized

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12457

    Nathan

    The V-Play Dialog type is too small for many use cases and, as far as I can tell, exposes no way to set its size. It would be more useful if it exposed properties with which I can control the size of the content area of the dialog.

    Is there a way to resize the dialog and I’m just missing it?

    #12458

    Günther
    V-Play Team

    Hi Nathan!

    I just had a look at our implementation of the Dialog – at the moment the content area size is always based on the app-window size.
    But there are already two hidden properties that handle the width and height of the dialog’s content area: contentWidth and contentHeight.
    You can use these properties for now to modify the size, for example like this:

    AppButton {
      text: "Custom Dialog"
      onClicked: customDialog.open()
    }
    
    Dialog {
      id: customDialog
      title: "Change Dialog Size?"
      positiveActionLabel: "Yes"
      negativeActionLabel: "No"
      onCanceled: close()
      onAccepted: image.height = image.height === dp(200) ? dp(50) : dp(200)
      // base the content area height (without dialog title and buttons) on the image height
      contentHeight: image.height 
      
      AppImage { //will be placed inside the dialogs content area
        id: image
        height: dp(50)
        anchors.horizontalCenter: parent.horizontalCenter
        source: "../assets/vplay-logo.png"
        fillMode: Image.PreserveAspectFit
      }
    }
    

     

    Best,
    Günther

    • This reply was modified 2 years, 9 months ago by  GT.
    • This reply was modified 2 years, 9 months ago by  GT.
    #12482

    Nathan

    Yep, that works great. Thanks!

    One other thing I note, though. In the default dialog, the “OK” button text is much smaller than the “Cancel” button text. I’m assuming that’s unexpected behavior? Screenshot here: http://ge.tt/5qZ0pzX2

    #12486

    Günther
    V-Play Team

    I agree that the button text sizes should match for the dialog to look good 😉
    Unfortunately I can’t reproduce this issue – which device/platform are you using, or do you apply any special styling settings?

    #12501

    Nathan

    I can’t reproduce it in a trivial demo app either, but I note that the trivial demo app uses the whole canned V-Play qmake project whereas my project uses qbs and may be missing some of the infrastructure the project templates have?

    Testing on Linux, with a 15″ 4k display (perhaps the high DPI is causing some fits?)

Viewing 5 posts - 1 through 5 (of 5 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support