Results 1 to 4 of 4

Thread: QT 4 qlabel how to work them

  1. #1
    Join Date
    Mar 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QT 4 qlabel how to work them

    Ok last time I programmed was with Delphi 3 visual pascal.

    I do know some C, C++

    now I am using QT 4.72 QT GUI widget. Since I cannot get a GUI working in designer.

    Still new, very knew.

    here is the problem.

    I added a qlabel called it "LStr" means Stregth.

    Now I made a button call Roll AGain. and made a goto on it for the click.

    I want to change the LStr test to say "18" or what ever I roll for it.

    I tried LStr.SetText("18");
    and
    LStr->SetText("18");

    but the program does not know what LStr is. ]

    Should the editor (QT) know what your labels are and there names.

    It was easy in Delphi but bit more confusion here.

    Once I see how this is done, should be easier for me to get into the swing of things.

    I hope

    Thanks for all the help in advanced.

    Tried to find a book but no lock here in small town of Cornwall, Ontario.

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT 4 qlabel how to work them

    You can show some code, and i didn't understood if you used the designer or not, so if you created LStr in Designer, then in C++ code you will access it through ui, something like: ui.LStr->setText(...) (in case ui is an object) or ui->LStr->setText(...) (in case ui is a pointer)

  3. #3
    Join Date
    Mar 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QT 4 qlabel how to work them

    the ui-> worked

    Sorry I tried to use a QT console application but had to use a QT GUI widget because I could get get a frame/panel gui interface to setup in QT console application.

    like I said just learning and can not find any good tutorials on basic programing in this environment.

  4. #4
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT 4 qlabel how to work them

    The official tutorials look good, take a look here

    Also this page deserves be bookmarked, since it contains articles on some Qt topics, like signals and slots, model view, etc.

    Also the Qt documentation website is very good.

Similar Threads

  1. QLabel background color doesn't work in toolbars
    By iig in forum Qt Programming
    Replies: 0
    Last Post: 10th August 2010, 11:30
  2. don't work qlineargradient for text in QLabel
    By GreenScape in forum Qt Programming
    Replies: 7
    Last Post: 29th July 2010, 16:59
  3. QLabel setPixmap doesnt work
    By arpspatel in forum Qt Programming
    Replies: 3
    Last Post: 1st March 2010, 22:24
  4. background-image on QLabel does NOT work
    By VireX in forum Newbie
    Replies: 2
    Last Post: 8th June 2007, 20:30
  5. Getting QLabel to work with WinAPI GetWindowText?
    By m.parker in forum Qt Programming
    Replies: 3
    Last Post: 22nd December 2006, 21:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.