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. Calling the MainWindow UI from another class
Qt 6.11 is out! See what's new in the release blog

Calling the MainWindow UI from another class

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.2k Views 1 Watching
  • 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.
  • _ Offline
    _ Offline
    _vladimir
    wrote on last edited by
    #1

    Hello,

    I connected a signal in client.cpp file to a slot in mainwindow.cpp file.

    The connection works , the QMessagebox in the slot is working.

    But the ui->blablabla won't work.

    I tried to delete the ~MainWindow() function who was trying to delete the pointer of *ui.

    But no positive results, have you any suggestion ??

    1 Reply Last reply
    0
    • T Offline
      T Offline
      thiberi0
      wrote on last edited by
      #2

      It's hard to understand without more information or code. To me looks like you're trying to access a private member of a class MainWindow, since normally the "ui" is marked as private.
      The programs is running or gives a compilation error?

      thiberi0

      1 Reply Last reply
      0
      • _ Offline
        _ Offline
        _vladimir
        wrote on last edited by
        #3

        i switched the ui and rest of pointers from ptivate to public

        But it still can't call the UI.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          thiberi0
          wrote on last edited by
          #4

          Can you post some code?

          thiberi0

          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