Forums

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

OverviewV-Play 2 Support (Qt 5)Dialog cannot be resized › Reply To: Dialog cannot be resized
#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, 6 months ago by  GT.
  • This reply was modified 2 years, 6 months ago by  GT.

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