How to get Widget from UI file
-
@SPlatten
Please just look (carefully) at the code. I said beforeWhatever, the answer lies in looking in
tabwidget.h
and/orui_tabwidget.h
since those are the entire code.If you don't follow put in breakpoints and step through, there is no magic and nothing external here.
-
@JonB , looking at the class as I said it does contain everything I need but I cannot find Ui_WsStatusPage (Class name) anywhere else in the file system or source code except in the header file itself.
-
@SPlatten
So put a breakpoint on its constructor, and onsetupUi()
..... If you are right, they will never be called and you can ignore all their code.wrote on 20 Jun 2022, 13:20 last edited by@JonB said in How to get Widget from UI file:
I wish I could, but the project is built with cmake, not in Qt Creator, I can only run it in the console.
-
@JonB said in How to get Widget from UI file:
I wish I could, but the project is built with cmake, not in Qt Creator, I can only run it in the console.
@SPlatten said in How to get Widget from UI file:
I wish I could, but the project is built with cmake, not in Qt Creator, I can only run it in the console.
You can use Qt Creator to open a CMakeLists.txt project and run console applications.
-
@JonB said in How to get Widget from UI file:
I wish I could, but the project is built with cmake, not in Qt Creator, I can only run it in the console.
-
@SPlatten
Then edit the code to put in aqDebug()
, or a message box, or a print to file, or whatever....Or, comment out that class, since you have said it is never used, and recompile.
-
@SPlatten Your changes will be overridden next time this header file is generated
-
wrote on 20 Jun 2022, 13:32 last edited by
@jsulm , ok, so how can I fix the tabs in the UI to do what I want? I'm done this without the tabs in the UI but its to be a job to rip it all apart. Right now I need to call setTabBar after all the initialisation has completed with the tabs added, but I cannot all setTTabBar outside of the class as its a protected method.
-
@jsulm , ok, so how can I fix the tabs in the UI to do what I want? I'm done this without the tabs in the UI but its to be a job to rip it all apart. Right now I need to call setTabBar after all the initialisation has completed with the tabs added, but I cannot all setTTabBar outside of the class as its a protected method.
-
@SPlatten
Outside of what class? I really don't know your code. If you need to access aprotected
method then subclass and you can do what you like?
19/19