Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. UI interface does not display
Forum Updated to NodeBB v4.3 + New Features

UI interface does not display

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 175 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bxrs
    wrote on last edited by
    #1

    main.cpp
    #include "clientSet.h"
    #include <QApplication>
    int main(int argc, char *argv[])
    {
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
    }
    clientSet.cpp
    MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    }
    Why does the client set interface not display after the program runs

    JonBJ 1 Reply Last reply
    0
    • B bxrs

      main.cpp
      #include "clientSet.h"
      #include <QApplication>
      int main(int argc, char *argv[])
      {
      QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      QApplication a(argc, argv);
      MainWindow w;
      w.show();
      return a.exec();
      }
      clientSet.cpp
      MainWindow::MainWindow(QWidget *parent)
      : QMainWindow(parent)
      , ui(new Ui::MainWindow)
      {
      ui->setupUi(this);
      }
      Why does the client set interface not display after the program runs

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @bxrs
      Please use the forum's Code tags (</> toolbar button) when pasting blocks of code.

      I presume that clientSet.cpp has #include "ui_clientSet.h" to include the .h file generated from the .ui file by running uic. And that file lives in the build output directory, not the source directory, and is being regenerated correctly?

      Start by replacing MainWindow w; by QMainWindow w; and report back as to whether that shows correctly. Then take it from there.

      Reading again, I am unsure whether "Why does the client set interface not display after the program runs" means you do not see any window/widget open and appear on your desktop (per my answer above) or whether you mean you do see a main window but it is empty/does not show what you designed into the .ui file? If it's the latter, check what is in the .ui file and in the generated ui_clientSet.h file. An occasional mistake is to find a file of that name somehow lying around in your sources directory, it must not be there. The one regenerated each time from changes in the .ui must be located in the build output directory and must not be overridden by one sitting in the source directory, check for that?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved