Qt Creator Documentation 2.8.0

Contents

QML ImageButton Element

A push button with a text label More...

Properties

Detailed Description

The ImageButton type provides a button with a text label that can be styled using images.

Here is a simple ImageButton:

 import QtQuick 1.1
 import "components"

     ImageButton {
         id: image_button1
         width: 60
         height: 40
         text: "Test"
         imageUp: "images/internal_button_up.bmp"
         font.pixelSize: 18
         textColor: "#000000"
         imageDown: "images/internal_button_dn.bmp"
         font.bold: false
         font.family: "Arial"
         onButtonClick: console.debug("clicked");
         onButtonPress: console.debug("pressed");
         onButtonRelease: console.debug("released");
 }

Property Documentation

autoRepeat : bool

If autoRepeat is enabled, then the buttonPress(), buttonRelease(), and buttonClick() signals are emitted at regular intervals when the button is down. autoRepeat is off by default. The initial delay and the repetition interval are defined in milliseconds by autoRepeatInterval.


disabled : bool

Determines if the ImageButton is enabled.


font : font

The font properties of the text of the label.


height : int

The height of the image button.


imageDown : url

The source image for the button's down state.


imageUp : url

The source image for the button's up state.


text : string

The text of the label shown within the button.


textColor : string

The color of the text of the label.


width : int

The width of the image button.