On Sat, May 1, 2021 at 1:22 AM Nicholas Yue <yue.nicho...@gmail.com> wrote:

>   but somehow, the MainWindow variety, I have not been able to
>
>
> https://github.com/nyue/QtQuestions/blob/main/Qt5/language_change/mainwindow/MainWindow.cpp
>

You're treating the main window that's instantiated as a `QWidget`.
Simply:
int main( ... )
{
   ...
   QUiLoader loader;
   QFile file(":/designer/mainwindow.ui");
   if (file.open(QFile::ReadOnly))
   {
      QMainWindow *mainWindow = qobject_cast<QMainWindow
*>(loader.load(&file));
      ...
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to