View Full Version : MSVC C++ project for QT problem...

4th July 2018, 13:18
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()));


private slots:
void handleButton();
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?

4th July 2018, 14:12
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.

Are You working with Visual Studio or with Qt Creator ?

4th July 2018, 16:23
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


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"


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.

5th July 2018, 08:10
Do you have a Qt plugin installed? Unfortunately, the drawings are unreadable.