Results 1 to 2 of 2

Thread: ui file and .cpp files do not agree with each other

  1. #1
    Join Date
    Dec 2010
    Location
    My bed
    Posts
    21
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default ui file and .cpp files do not agree with each other

    When I design the layout of my program on the form designer, I put all the buttons and lineEdits and I give them object names,
    but when I connect those object names with commands, it says that the pushButton was nor declared or that the LineEdit was not declared.

    /home/lancaster/QtProjects/pop-build-desktop/../pop/myqtapp.cpp:11: error: ‘pushButton_Browse’ was not declared in this scope

  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: ui file and .cpp files do not agree with each other

    Look at the class definition, most likely you will need to access the Ui elements with the help of the ui pointer, something like:
    Qt Code:
    1. connect(ui->widgetName, SIGNAL//(...)...
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QPrintPreview File, printing PDF Files
    By opra in forum Qt Programming
    Replies: 7
    Last Post: 20th June 2013, 16:00
  2. add .html files to a .qch file?
    By evilbunny in forum Newbie
    Replies: 0
    Last Post: 17th December 2010, 01:27
  3. Extracting files from a zip file
    By Althor in forum Qt Programming
    Replies: 4
    Last Post: 11th March 2009, 10:39
  4. Generating .pro files from vcproj file or CMake file
    By ramazangirgin in forum Qt Programming
    Replies: 2
    Last Post: 17th February 2009, 09:37
  5. how to include object files in .pro file
    By babu198649 in forum Newbie
    Replies: 1
    Last Post: 1st July 2008, 08:23

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.