Results 1 to 4 of 4

Thread: MSVC C++ project for QT problem...

  1. #1
    Join Date
    Jul 2018
    Posts
    26
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default MSVC C++ project for QT problem...

    When I put pushbutton in my code like:

    // Create the button, make "this" the parent
    m_button = new QPushButton("My Button", this);
    // set size and location of the button
    m_button->setGeometry(QRect(QPoint(100, 100),
    QSize(200, 50)));

    // Connect button signal to appropriate slot
    connect(m_button, SIGNAL (released()), this, SLOT (handleButton()));

    and

    private slots:
    void handleButton();
    private:
    QPushButton *m_button;

    everything works fine but I could not see that button in QDesigner and vice versa when I include push button in my QT form .ui I could not see that at all. It is not only pushbutton but all components what I could pick from WidgetBox. I suspect some problem with seting up include inside Visual C++ projects.

    What can I do?

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,521
    Thanked 278 Times in 273 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MSVC C++ project for QT problem...

    Generally, you can not mix UI creation of one class in code and in GUI Designer. The objects created in the code are not visible in the GUI Designer. It works only in one direction: GUI Designer (ui file) -> program code.

    P.S.
    Are You working with Visual Studio or with Qt Creator ?

  3. #3
    Join Date
    Jul 2018
    Posts
    26
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MSVC C++ project for QT problem...

    I understand what you stated. I worked on Visual Studio. Then I have to double click on MyProgram.ui. It is QTDesigner. Then I can put for example a few buttons on that

    Capture1.jpg.

    Then I have problem to generate slot to respond on clicked event on button let say button START.
    As you can see I cannot see usual option "GO TO SLOTS"

    capture2.jpg

    So I can not generate in this way slot which will respond on clicked button "START".
    That is problem which I was to resolve from the beginning.
    Last edited by Pereubu2018; 4th July 2018 at 16:29.

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,521
    Thanked 278 Times in 273 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MSVC C++ project for QT problem...

    Do you have a Qt plugin installed? Unfortunately, the drawings are unreadable.

Similar Threads

  1. Qt Project files, determining if Qt or MSVC
    By Festus Hagen in forum Qt Tools
    Replies: 0
    Last Post: 24th July 2013, 22:38
  2. MSVC Project generated using qmake - turn off flat structure
    By Piskvorkar in forum Qt Programming
    Replies: 3
    Last Post: 5th February 2013, 00:25
  3. Replies: 1
    Last Post: 29th September 2011, 12:14
  4. Replies: 1
    Last Post: 21st September 2010, 09:58
  5. Problem with compiling Qt 4.6 via MSVC 2010 Beta2 (win32-msvc specs)
    By Erik-Moscow in forum Installation and Deployment
    Replies: 2
    Last Post: 17th December 2009, 19:44

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.