Forums

OverviewV-Play 2 Support (Qt 5)Trouble publishing code that uses img tag in Text › Reply To: Trouble publishing code that uses img tag in Text

OverviewV-Play 2 Support (Qt 5)Trouble publishing code that uses img tag in Text › Reply To: Trouble publishing code that uses img tag in Text
#8912

Martin

I realised a workaround:

 

     // Preferences
     MenuButton {
-        text: 'img src="../../assets/img/cog.png" height="20" width="20"'
+        id: settingsButton
+        text: "      "
         font.pixelSize: 14
         // anchor the button to the gameWindowAnchorItem to be on the edge of the screen on any device
         anchors.left: selectLevelScene.gameWindowAnchorItem.left
         anchors.leftMargin: 10
         anchors.bottom: selectLevelScene.gameWindowAnchorItem.bottom
         anchors.bottomMargin: 10
         onClicked: preferencesButtonPressed()
     }
 
+    Image {
+        id: settingsButtonLabel
+        source: "../../assets/img/cog.png"
+        anchors.centerIn: settingsButton
+        height: 20
+        width: 20
+    }
+

 

… obviously not as nice as the embedded img though :)

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