emit qml signal on start application

Andreas

Is there a way to emit or is there a signal that is emitted at the start of an application in qml?

My purpose is to check wether some values are in a list and when, then I want to enable a button.

Something like:

Rectangle{ id:main 
   Button {
      id:myButton
      checkable: false
      onClicked: { /* do something */ }
   }
   // First variant
   Connections: {
      target: myClass
      onSignalEmit() { myButton.checkable = true }
   }
   // Second varinat
   emit startUp()
}   
folibis

As @Retired Ninja said you can use Component.onCompleted in this case

http://qt-project.org/doc/qt-5/qtqml-javascript-expressions.html#javascript-in-application-startup-code

Rectangle{ 
    id:main
    ....
    Component.onCompleted: startUp();
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

emit qml signal on start application

From Dev

Does an Item emit a signal when its position/size is changed in QML?

From Dev

QML Cannot emit signal if it has same name as property

From Dev

QItemSelectionModel currentChange signal is emitted on application start?

From Dev

How to emit signal in context of specific QML Item from C++ code

From Dev

How to emit signal in context of specific QML Item from C++ code

From Dev

Emit a signal in a static function

From Dev

GStreamer - Emit a signal to an element

From Dev

Execute JS code right after QML Application start

From Dev

Execute JS code right after QML Application start

From Dev

Emit signal in standard python thread

From Dev

Can't emit signal in Android

From Dev

Wait for several objects to emit a signal

From Dev

QML On Item Changed Signal

From Dev

Exposing an enum in a QML signal

From Dev

Signal between QML with Repeater

From Dev

start on emit is not working on upstart

From Dev

QML - connect a signal from c++ to qml

From Dev

QML signal QT slot with QQuickView

From Dev

QGraphicsitem emit signal when selected/unselected?

From Dev

Emit Signal Only When QCheckBox is Checked

From Dev

How to emit a Qt signal daily at a given time?

From Dev

In QT is it safe to emit a signal from a closeEvent function?

From Dev

Can we emit a signal from a public slot

From Dev

How to emit a delayed signal in PyQt GUI?

From Dev

Qt - how to emit a signal from derived class?

From Dev

Emit safely a signal from a thread and connect it to a widget

From Dev

When does a `QTreeView` emit the activated signal on Mac?

From Dev

How to emit a delayed signal in PyQt GUI?

Related Related

HotTag

Archive