Forums

OverviewV-Play 2 Support (Qt 5) › Button at the right top

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12140

    Cho

    Hi, I want to add a pause/play button at the right top corner with margin 10 10. Now, I use a rectangle with a button inside it. Can I make that rectangle transparent or is there any other way to implement it?

    Help me please.

    #12141

    Cho

    I used color:”transparent” and it solved :3

    #12142

    Alex
    V-Play Team

    Hi,

    Glad you already solved that on your own. Just for reference, here are some more possibilities:

    1. Every visual QML item has some margin properties, so you can add that margin with:

    Button {
      anchors.top: parent.top
      anchors.right: parent.right
      anchors.topMargin: 10
      anchors.rightMargin: 10
    }

    2. You can also wrap you button in a more generic component named Item, this way you don’t have to set the color of your Rectangle component and it saves a little bit of performance.

    3. You can still use absolute positioning (calculating the x value of your button from the parent’s width and the button’s width), i however don’t recommend that one.

    Best,

    Alex

    #12144

    Cho

    Thanks… I recoded with your first solution… It will be better…

Viewing 4 posts - 1 through 4 (of 4 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