Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Component.onStart ?
Forum Update on Monday, May 27th 2025

Component.onStart ?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 497 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Circuits
    wrote on 9 Sept 2019, 14:21 last edited by
    #1

    I have a bit of a problem. I am setting VirtualKeyboardSettings.locale just prior to creating a component in this rectangles MouseArea{} based on an index (0-3):

    MouseArea {
    	anchors.fill: parent
    	onClicked: {
    
    	switch(languageManager.localeIndex)
    	{
    		case 0:
    		VirtualKeyboardSettings.locale = "en_US"
    		break;
    		case 1:
    		VirtualKeyboardSettings.locale = "es_ES"
    		break;
    		case 2:
    		VirtualKeyboardSettings.locale = "fr_FR"
    		break;
    		case 3:
    		VirtualKeyboardSettings.locale = "pl_PL"
    		break;
    	}
    
    	minMaxSplitBtn.showKeyboard()
    	}
    }
    

    The component itself hosts the QTVK's InputPanel{} who's visible property is set to true. I am looking for a way to set the VirtualKeyboardSettings.locale the moment the component is created but from within the component's .qml file rather than doing it here where the component is being created. Is that possible? I figured it would be something like: Component.start or something along those lines if it did exist. Perhaps I could make this a property or something along those lines?

    V 1 Reply Last reply 10 Sept 2019, 14:46
    0
    • C Offline
      C Offline
      Circuits
      wrote on 10 Sept 2019, 14:27 last edited by
      #2

      Perhaps this isn't necessary? Is there some way for me to set the .local for the keyboard in c++ code? In the business logic?

      1 Reply Last reply
      0
      • C Circuits
        9 Sept 2019, 14:21

        I have a bit of a problem. I am setting VirtualKeyboardSettings.locale just prior to creating a component in this rectangles MouseArea{} based on an index (0-3):

        MouseArea {
        	anchors.fill: parent
        	onClicked: {
        
        	switch(languageManager.localeIndex)
        	{
        		case 0:
        		VirtualKeyboardSettings.locale = "en_US"
        		break;
        		case 1:
        		VirtualKeyboardSettings.locale = "es_ES"
        		break;
        		case 2:
        		VirtualKeyboardSettings.locale = "fr_FR"
        		break;
        		case 3:
        		VirtualKeyboardSettings.locale = "pl_PL"
        		break;
        	}
        
        	minMaxSplitBtn.showKeyboard()
        	}
        }
        

        The component itself hosts the QTVK's InputPanel{} who's visible property is set to true. I am looking for a way to set the VirtualKeyboardSettings.locale the moment the component is created but from within the component's .qml file rather than doing it here where the component is being created. Is that possible? I figured it would be something like: Component.start or something along those lines if it did exist. Perhaps I could make this a property or something along those lines?

        V Offline
        V Offline
        VRonin
        wrote on 10 Sept 2019, 14:46 last edited by
        #3

        @circuits said in Component.onStart ?:

        I figured it would be something like: Component.start or something along those lines if it did exist

        https://felgo.com/doc/felgo-qml-tree-basics/#constructor

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        C 1 Reply Last reply 10 Sept 2019, 19:57
        1
        • V VRonin
          10 Sept 2019, 14:46

          @circuits said in Component.onStart ?:

          I figured it would be something like: Component.start or something along those lines if it did exist

          https://felgo.com/doc/felgo-qml-tree-basics/#constructor

          C Offline
          C Offline
          Circuits
          wrote on 10 Sept 2019, 19:57 last edited by
          #4

          @vronin I guess I figured that by "onCompleted" they meant when the component was finished but apparently they were referring to the completion of the creation of the component? In any case, thank you!

          1 Reply Last reply
          0

          1/4

          9 Sept 2019, 14:21

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved