Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QInputDialog
Qt 6.11 is out! See what's new in the release blog

QInputDialog

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 5 Posters 4.3k Views 3 Watching
  • 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.
  • D Offline
    D Offline
    DivyaMuthyala
    wrote on last edited by
    #1

    Hi,

    I am trying to set default cusor position in linedit in Inputdialog, but its not happening.
    I have tried by using setCursorPosition , but its not working.

    please give me solution.

    Thanks in advance.

    jsulmJ 1 Reply Last reply
    0
    • D DivyaMuthyala

      Hi,

      I am trying to set default cusor position in linedit in Inputdialog, but its not happening.
      I have tried by using setCursorPosition , but its not working.

      please give me solution.

      Thanks in advance.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @DivyaMuthyala Is the line edit empty?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Can you show your code ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • yuvaramY Offline
          yuvaramY Offline
          yuvaram
          wrote on last edited by yuvaram
          #4

          Hi @DivyaMuthyala

          look at the code which is shared by me, even after issue is not solved, share your code

          Widget::Widget(QWidget *parent)
          : QWidget(parent)
          {
          m_PB1 = new QPushButton("ShowInputDialog",this);
          connect(m_PB1,SIGNAL(clicked(bool)),this,SLOT(slt_getInputDialog()));
          }

          Widget::~Widget()
          {

          }

          void Widget::slt_getInputDialog(){
          bool ok;
          QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),
          tr("User name:"), QLineEdit::Normal, "Enter here", &ok);

          }

          Yuvaram Aligeti
          Embedded Qt Developer
          : )

          joeQJ 2 Replies Last reply
          0
          • yuvaramY yuvaram

            Hi @DivyaMuthyala

            look at the code which is shared by me, even after issue is not solved, share your code

            Widget::Widget(QWidget *parent)
            : QWidget(parent)
            {
            m_PB1 = new QPushButton("ShowInputDialog",this);
            connect(m_PB1,SIGNAL(clicked(bool)),this,SLOT(slt_getInputDialog()));
            }

            Widget::~Widget()
            {

            }

            void Widget::slt_getInputDialog(){
            bool ok;
            QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),
            tr("User name:"), QLineEdit::Normal, "Enter here", &ok);

            }

            joeQJ Offline
            joeQJ Offline
            joeQ
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • yuvaramY yuvaram

              Hi @DivyaMuthyala

              look at the code which is shared by me, even after issue is not solved, share your code

              Widget::Widget(QWidget *parent)
              : QWidget(parent)
              {
              m_PB1 = new QPushButton("ShowInputDialog",this);
              connect(m_PB1,SIGNAL(clicked(bool)),this,SLOT(slt_getInputDialog()));
              }

              Widget::~Widget()
              {

              }

              void Widget::slt_getInputDialog(){
              bool ok;
              QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),
              tr("User name:"), QLineEdit::Normal, "Enter here", &ok);

              }

              joeQJ Offline
              joeQJ Offline
              joeQ
              wrote on last edited by
              #6

              @yuvaram
              Hi, friend. i tried your code. it is fine at my qt. the QInputDialog lineEdit can get the cursor when Dialog shown. like the following gif.

              gif image

              my code
              void Widget::on_btn_clicked()
              {
                  bool ok;
                  QString text = QInputDialog::getText(this, tr("Title"), tr("User name:"), QLineEdit::Normal, tr("your name at here"),&ok);
                  if (ok && !text.isEmpty())
                      qDebug() << text;
              }
              

              My Qt is 5.6 version And OS is Win10

              1 Reply Last reply
              0
              • yuvaramY Offline
                yuvaramY Offline
                yuvaram
                wrote on last edited by
                #7

                Hi @joeQ
                Whats the steps to make gif file. As demo will be easy further.
                :)

                Yuvaram Aligeti
                Embedded Qt Developer
                : )

                joeQJ 1 Reply Last reply
                1
                • yuvaramY yuvaram

                  Hi @joeQ
                  Whats the steps to make gif file. As demo will be easy further.
                  :)

                  joeQJ Offline
                  joeQJ Offline
                  joeQ
                  wrote on last edited by
                  #8

                  @yuvaram
                  Your mean is How to create gif file? oh, I used the little tool. If you want , you can give me your email. I will shared it to you.

                  Maybe you can download from net. Tool's name is GifCam

                  1 Reply Last reply
                  1

                  • Login

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