How do I make QtDesigner see slots and signals from other classes objects?
-
@mrjbom said in How do I make QtDesigner see slots and signals from other classes objects?:
now I want one of the objects of my classes
Where are those objects/instances created? Designer only knows about objects created inside widgets you're creating/editing in designer.
-
Hi
It only shows QWidgets from the same form.
It cant see other custom classes or anything like that.So " one of the objects of my classes " means some objects you generate in code or what excatly do you mean ?
-
@mrjbom usually the main window of your UI is a member of your default class (unless you changed it it is MainWindow). If you created other windows and want to connect to them you can include their header files in your main class - how to make them visible and when is what you need to code. There are some restrictions, like you should only have one QMainWindow in your program; more detail can be found in Qt Main Window Framework section of the documentation.
-
@mrjbom How should this work - how should the designer know where you instantiate those (and how often, ...)?
-
@mrjbom
The simple answer is: Don't bother to even try using that "Signal/Slot" set up thing at all in Designer! I think you will find most of us do not. Do yourconnect()
s explicitly in code. What the Designer does is pretty limited, and can have issues. Just saying. -
@Christian-Ehrlicher, perhaps similar to how I use " Promoted Class"
-
@mrjbom said in How do I make QtDesigner see slots and signals from other classes objects?:
perhaps similar to how I use " Promoted Class"
You do not understand the problem. How should the designer know how and where you create those different instances so it can somehow automatically create the connects?