Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved QLineEdit, adjust Widget position in MainWindow (not cursor)

    General and Desktop
    2
    4
    592
    Loading More Posts
    • 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.
    • yczo
      yczo last edited by

      Hello folks, I have some QlineEdit in mainWindow....

      QLineEdit *ql[10];
      for (int i=0; i < 10; i++) {
      ql[i]= new QLineEdit(this);
      }

      Someone so kind to explain me how can I adjust the position and size of each inside the for?
      I miss some like ql[i]->setPosition(x,y)

      thanks in advance.

      1 Reply Last reply Reply Quote 0
      • yczo
        yczo last edited by yczo

        the solution is

        ql[i]->move(x,y);

        Sorry I could not find at first by asking wrong to google

        1 Reply Last reply Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          Out of curiosity, why not use one of Qt's layout for that (e.g. QGridLayout) ?

          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 Reply Quote 0
          • yczo
            yczo last edited by yczo

            Because I have not Idea XDD, first new!, thank you

            1 Reply Last reply Reply Quote 0
            • First post
              Last post