Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Learning
  3. Qt in Education
  4. LineEdit
QtWS25 Last Chance

LineEdit

Scheduled Pinned Locked Moved Qt in Education
6 Posts 3 Posters 2.8k 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.
  • Y Offline
    Y Offline
    yakine
    wrote on 15 Mar 2014, 22:44 last edited by
    #1

    hello
    help me please
    am trying to create a window wich contain a lineEdit but it 's not work fo me the lineEdit don't apear in the window
    here is my code
    @
    #include <QApplication>
    #include <QtWidgets>
    #include <QtGui>
    #include <QLineEdit>
    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    QWidget fenetre;
    
    fenetre.setWindowIcon(QIcon("depositphotos_4161065-Medical-background.jpg"));
    fenetre.setWindowTitle("yakine");
    QLineEdit monChamp("Contenu du champ");
    QString contenu = monChamp.text();
    
    fenetre.show();
    
    return app.exec&#40;&#41;;
    

    }
    @

    [edit, code tags added, koahnig]

    IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on 16 Mar 2014, 11:28 last edited by
      #2

      "Please use code wrapping tags.":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 Those make your code readable in the forum.

      That is not the way you are using Qt for setting up a window with an input line. "Have a look to these examples":http://qt-project.org/doc/qt-5/examples-dialogs.html

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        yakine
        wrote on 16 Mar 2014, 13:30 last edited by
        #3

        thank you koahnig but if you can give an code example to what i need because i am newer in programation

        IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

        1 Reply Last reply
        0
        • C Offline
          C Offline
          clochydd
          wrote on 16 Mar 2014, 15:54 last edited by
          #4

          Hi yakine,
          the best way to start is indeed working through some samples.
          I suggest you have a look at the Qt style sheet example - don't care for the style sheets itself but use it as a template for working with the Qt Creator and the most common widgets.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on 16 Mar 2014, 16:18 last edited by
            #5

            "There are also many tutorials around, please check them out.":http://lmgtfy.com/?q=qt+start+tutorial In the tutorials on youtube you can find how to use Qt creator. They may be a bit outdated once in a while since Qt creator is still developed, but you will see and find easily youir way around.

            The "dialog example":http://qt-project.org/doc/qt-5/qtwidgets-dialogs-standarddialogs-example.html is an easy one to start with. Just try to use it in Qt creator and comment out stuff to see the effects.
            You see also in this example that nothing is really done in the main program.

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • Y Offline
              Y Offline
              yakine
              wrote on 16 Mar 2014, 17:34 last edited by
              #6

              thank you Clochydd
              thank you koahnig

              IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

              1 Reply Last reply
              0

              2/6

              16 Mar 2014, 11:28

              4 unread
              • Login

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