Results 1 to 20 of 22

Thread: Using gui objectNames when coding

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2010
    Posts
    34
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    10

    Default Re: Using gui objectNames when coding

    Classes aren't something I've used in my limited experience of C++, so I will go away and read up them now, cheers

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: Using gui objectNames when coding

    Good idea, you'll be using them a lot in Qt programming

  3. #3
    Join Date
    Dec 2010
    Posts
    34
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    10

    Default Re: Using gui objectNames when coding

    Just cracked it, thanks. I didn't realise that what I put in setText() has to be of type QString!

  4. #4
    Join Date
    Dec 2010
    Posts
    34
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    10

    Default Re: Using gui objectNames when coding

    Another day, another problem!

    When I try to access labels via ui->label_X, some of them aren't appearing. I entered the name manually, but when I compile, I get the error " 'class ui_guibrachy' has no member name 'label_X'

    Have I turned something off that I don't know about

    I tried adding a button to see if that showed up, which it didn't. Could it be that I designed the ui on Mac OS X and today I'm using windows?!

    Thanks.

  5. #5
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanked 342 Times in 324 Posts

    Default Re: Using gui objectNames when coding

    When I try to access labels via ui->label_X, some of them aren't appearing. I entered the name manually, but when I compile, I get the error " 'class ui_guibrachy' has no member name 'label_X'
    1. Open this file with designer and double-check the object's names.
    2. Make sure you have saved changes.
    3. Make sure that you compile correct .ui file ( check if its included in your .pro project file ) and include correct ui header in your sources.
    4. Check for typos in source files.
    5. Do a clean build ( make clean, qmake, make [debug/release] ) .

    There is a big chance of success if you do all of this correctly

    I tried adding a button to see if that showed up, which it didn't
    You mean that you've added a button via designer and it wont show up in you app ? If yes, then double-check 2) and 3)

  6. #6
    Join Date
    Dec 2010
    Posts
    34
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    10

    Default Re: Using gui objectNames when coding

    1. Done
    2. Done (closed and opened again to make sure they're there)
    3. Done (all in the proj file)
    4. Looks OK
    5. Think I did this, Build->clean all

    Any other ideas

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Using gui objectNames when coding

    look in ui_guibrachy.h see if you can spot your label object.
    If not, then some or all of steps 1-3 you didn't do right.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Coding a game with Qt
    By seltra in forum Qt Programming
    Replies: 5
    Last Post: 5th October 2010, 21:49
  2. VC++ 9.0 coding Symbian ?
    By nhs_0702 in forum Qt Programming
    Replies: 0
    Last Post: 3rd May 2010, 04:48
  3. Replies: 6
    Last Post: 30th January 2010, 00:56
  4. Replies: 0
    Last Post: 18th July 2009, 14:07
  5. What is your coding style ??
    By guestgulkan in forum General Discussion
    Replies: 9
    Last Post: 29th May 2006, 10:22

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.