Warning, /maui/mauikit/src/controls.5/InputDialog.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.15
0002 import QtQuick.Controls 2.15
0003 import QtQuick.Layouts 1.12
0004 
0005 import org.mauikit.controls 1.3 as Maui
0006 
0007 /**
0008  * NewDialog
0009  * A global sidebar for the application window that can be collapsed.
0010  *
0011  *
0012  *
0013  *
0014  *
0015  *
0016  */
0017 Maui.InfoDialog
0018 {
0019     id: control
0020 
0021     property bool entryField: true
0022     property alias textEntry: _textEntry
0023     /**
0024       * finished :
0025       */
0026     signal finished(string text)
0027 
0028     standardButtons: Dialog.Ok | Dialog.Cancel
0029 
0030     TextField
0031     {
0032         id: _textEntry
0033         Layout.fillWidth: true
0034 //        onAccepted: control.acceptButton.forceActiveFocus()
0035     }
0036 
0037     onAccepted: 
0038     {
0039         finished(control.textEntry.text)
0040         textEntry.clear()
0041         close()
0042     }
0043     
0044     onRejected:
0045     {
0046         textEntry.clear()
0047         control.close()
0048     }
0049 
0050     onOpened:
0051     {
0052         textEntry.forceActiveFocus()
0053         textEntry.selectAll()
0054     }    
0055 }