Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. include header OK, include ui fails
Forum Updated to NodeBB v4.3 + New Features

include header OK, include ui fails

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 3 Posters 267 Views 3 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    SOLVED

    QWidget *TAB_DIALOG = new A_BT_TAB_DIALOG();

    SHOULD BE

    A_BT_TAB_DIALOG *TAB_DIALOG = new A_BT_TAB_DIALOG();

    Another include hell...
    

    Can somebody seriously explain why ? (see title)
    I can modify ui in class constructor
    ui exists !
    but I cannot in other code .
    intelisense does not see "ui "

    QWidget *TAB_DIALOG = new A_BT_TAB_DIALOG();
    m_mdiarea->addSubWindow( TAB_DIALOG);
    TAB_DIALOG->setWindowTitle(" Common hcitool TAB "); // TOK
    TAB_DIALOG->ui->setToolTip(" Another tool tip...");

    and here is the error

    /mnt/A_BT_DEC10/BT__PROGRAMS/A_DEC31_V1/A_BT_LIBRARY/terminal_Bluetooth/mainwindow_Bluetooth.cpp:183: error: no member named 'ui' in 'QWidget'
    mainwindow_Bluetooth.cpp:183:17: error: no member named 'ui' in 'QWidget'
    TAB_DIALOG->ui->setToolTip(" Another tool tip...");
    ~~~~~~~~~~ ^

    I am asking for best guess explanation of THIS error.

    Here are the includes , compiler /linker has no issue

    
    #include "../../../A_BT_LIBRARY/CCC_SOURCE/A_BT_TAB_DIALOG/a_bt_tab_dialog.h"
    #include "../../../A_BT_LIBRARY/CCC_SOURCE/A_BT_TAB_DIALOG/ui_a_bt_tab_dialog.h"
    
    
    Christian EhrlicherC Pl45m4P 2 Replies Last reply
    0
    • A Anonymous_Banned275

      SOLVED

      QWidget *TAB_DIALOG = new A_BT_TAB_DIALOG();

      SHOULD BE

      A_BT_TAB_DIALOG *TAB_DIALOG = new A_BT_TAB_DIALOG();

      Another include hell...
      

      Can somebody seriously explain why ? (see title)
      I can modify ui in class constructor
      ui exists !
      but I cannot in other code .
      intelisense does not see "ui "

      QWidget *TAB_DIALOG = new A_BT_TAB_DIALOG();
      m_mdiarea->addSubWindow( TAB_DIALOG);
      TAB_DIALOG->setWindowTitle(" Common hcitool TAB "); // TOK
      TAB_DIALOG->ui->setToolTip(" Another tool tip...");

      and here is the error

      /mnt/A_BT_DEC10/BT__PROGRAMS/A_DEC31_V1/A_BT_LIBRARY/terminal_Bluetooth/mainwindow_Bluetooth.cpp:183: error: no member named 'ui' in 'QWidget'
      mainwindow_Bluetooth.cpp:183:17: error: no member named 'ui' in 'QWidget'
      TAB_DIALOG->ui->setToolTip(" Another tool tip...");
      ~~~~~~~~~~ ^

      I am asking for best guess explanation of THIS error.

      Here are the includes , compiler /linker has no issue

      
      #include "../../../A_BT_LIBRARY/CCC_SOURCE/A_BT_TAB_DIALOG/a_bt_tab_dialog.h"
      #include "../../../A_BT_LIBRARY/CCC_SOURCE/A_BT_TAB_DIALOG/ui_a_bt_tab_dialog.h"
      
      
      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      As you can see in the QWidget documentation, QWidget has not member 'ui'. Maybe A_BT_TAB_DIALOG has but the pointer is of type QWidget.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3
      • A Anonymous_Banned275

        SOLVED

        QWidget *TAB_DIALOG = new A_BT_TAB_DIALOG();

        SHOULD BE

        A_BT_TAB_DIALOG *TAB_DIALOG = new A_BT_TAB_DIALOG();

        Another include hell...
        

        Can somebody seriously explain why ? (see title)
        I can modify ui in class constructor
        ui exists !
        but I cannot in other code .
        intelisense does not see "ui "

        QWidget *TAB_DIALOG = new A_BT_TAB_DIALOG();
        m_mdiarea->addSubWindow( TAB_DIALOG);
        TAB_DIALOG->setWindowTitle(" Common hcitool TAB "); // TOK
        TAB_DIALOG->ui->setToolTip(" Another tool tip...");

        and here is the error

        /mnt/A_BT_DEC10/BT__PROGRAMS/A_DEC31_V1/A_BT_LIBRARY/terminal_Bluetooth/mainwindow_Bluetooth.cpp:183: error: no member named 'ui' in 'QWidget'
        mainwindow_Bluetooth.cpp:183:17: error: no member named 'ui' in 'QWidget'
        TAB_DIALOG->ui->setToolTip(" Another tool tip...");
        ~~~~~~~~~~ ^

        I am asking for best guess explanation of THIS error.

        Here are the includes , compiler /linker has no issue

        
        #include "../../../A_BT_LIBRARY/CCC_SOURCE/A_BT_TAB_DIALOG/a_bt_tab_dialog.h"
        #include "../../../A_BT_LIBRARY/CCC_SOURCE/A_BT_TAB_DIALOG/ui_a_bt_tab_dialog.h"
        
        
        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by
        #3

        @AnneRanch said in include header OK, include ui fails:

        intelisense does not see "ui "

        Not every QWidget / QObject class you've created, has a user interface.
        ui is just the reference to objects in the compiled *.ui designer file.

        By the way, since you asked for consistancy lately: You should make your code (variable names, struture etc.) also more consistent.
        Your code gets more and more confusing, even these tiny snippets already.

        A_BT_TAB_DIALOG is a filename and a class name whereas TAB_DIALOG is a pointer variable... later no one will be able to keep track of things, because everything is named differently from time to time.


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        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