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. No member named X in
Forum Updated to NodeBB v4.3 + New Features

No member named X in

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 5 Posters 925 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.
  • C Offline
    C Offline
    Cervo2paille
    wrote on last edited by Cervo2paille
    #1

    Hello Everyone,
    I got the following error :
    ksnip_20220911-212750.png

    I can call my page itselft and it's work, but when i call another (MainWindow), it doesn't find the "setModal".
    Why ?
    If you need mainwindow.h :

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QMainWindow>
    
    QT_BEGIN_NAMESPACE
    namespace Ui { class MainWindow; }
    QT_END_NAMESPACE
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        MainWindow(QWidget *parent = nullptr);
        ~MainWindow();
    
    private slots:
        void on_pushButton_3_clicked();
    
    private:
        Ui::MainWindow *ui;
    };
    #endif // MAINWINDOW_H
    
    

    and my pageprincipale.h :

    #ifndef PAGEPRINCIPALE_H
    #define PAGEPRINCIPALE_H
    
    #include <QDialog>
    
    namespace Ui {
    class pagePrincipale;
    }
    
    class pagePrincipale : public QDialog
    {
        Q_OBJECT
    
    public:
        explicit pagePrincipale(QWidget *parent = nullptr);
        ~pagePrincipale();
    
    private slots:
        void on_pushButton_clicked();
    
    private:
        Ui::pagePrincipale *ui;
    };
    
    #endif // PAGEPRINCIPALE_H
    
    

    Thank you

    Christian EhrlicherC M 2 Replies Last reply
    0
    • C Cervo2paille

      Hello Everyone,
      I got the following error :
      ksnip_20220911-212750.png

      I can call my page itselft and it's work, but when i call another (MainWindow), it doesn't find the "setModal".
      Why ?
      If you need mainwindow.h :

      #ifndef MAINWINDOW_H
      #define MAINWINDOW_H
      
      #include <QMainWindow>
      
      QT_BEGIN_NAMESPACE
      namespace Ui { class MainWindow; }
      QT_END_NAMESPACE
      
      class MainWindow : public QMainWindow
      {
          Q_OBJECT
      
      public:
          MainWindow(QWidget *parent = nullptr);
          ~MainWindow();
      
      private slots:
          void on_pushButton_3_clicked();
      
      private:
          Ui::MainWindow *ui;
      };
      #endif // MAINWINDOW_H
      
      

      and my pageprincipale.h :

      #ifndef PAGEPRINCIPALE_H
      #define PAGEPRINCIPALE_H
      
      #include <QDialog>
      
      namespace Ui {
      class pagePrincipale;
      }
      
      class pagePrincipale : public QDialog
      {
          Q_OBJECT
      
      public:
          explicit pagePrincipale(QWidget *parent = nullptr);
          ~pagePrincipale();
      
      private slots:
          void on_pushButton_clicked();
      
      private:
          Ui::pagePrincipale *ui;
      };
      
      #endif // PAGEPRINCIPALE_H
      
      

      Thank you

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Cervo2paille said in No member named X in:

      I can call my page itselft and it's work, but when i call another (MainWindow), it doesn't find the "setModal".

      Because QMainWindow has no such a function: https://doc.qt.io/qt-6/qmainwindow-members.html, only QDialog has such functions.

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

      C 1 Reply Last reply
      2
      • C Cervo2paille

        Hello Everyone,
        I got the following error :
        ksnip_20220911-212750.png

        I can call my page itselft and it's work, but when i call another (MainWindow), it doesn't find the "setModal".
        Why ?
        If you need mainwindow.h :

        #ifndef MAINWINDOW_H
        #define MAINWINDOW_H
        
        #include <QMainWindow>
        
        QT_BEGIN_NAMESPACE
        namespace Ui { class MainWindow; }
        QT_END_NAMESPACE
        
        class MainWindow : public QMainWindow
        {
            Q_OBJECT
        
        public:
            MainWindow(QWidget *parent = nullptr);
            ~MainWindow();
        
        private slots:
            void on_pushButton_3_clicked();
        
        private:
            Ui::MainWindow *ui;
        };
        #endif // MAINWINDOW_H
        
        

        and my pageprincipale.h :

        #ifndef PAGEPRINCIPALE_H
        #define PAGEPRINCIPALE_H
        
        #include <QDialog>
        
        namespace Ui {
        class pagePrincipale;
        }
        
        class pagePrincipale : public QDialog
        {
            Q_OBJECT
        
        public:
            explicit pagePrincipale(QWidget *parent = nullptr);
            ~pagePrincipale();
        
        private slots:
            void on_pushButton_clicked();
        
        private:
            Ui::pagePrincipale *ui;
        };
        
        #endif // PAGEPRINCIPALE_H
        
        

        Thank you

        M Offline
        M Offline
        mpergand
        wrote on last edited by mpergand
        #3

        @Cervo2paille
        Salut,

        There is some confusion between pageprincipale and MainWidow.

        pageprincipale is your dialog.
        And this is MainWindow that receives the signal on_pushButton_3_clicked, not pageprincipale.

        Cerveau de paille tĂȘte en l'air :)

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @Cervo2paille said in No member named X in:

          I can call my page itselft and it's work, but when i call another (MainWindow), it doesn't find the "setModal".

          Because QMainWindow has no such a function: https://doc.qt.io/qt-6/qmainwindow-members.html, only QDialog has such functions.

          C Offline
          C Offline
          Cervo2paille
          wrote on last edited by Cervo2paille
          #4

          @Christian-Ehrlicher
          Thank you. So i can't call my QMainWindow ? Maybe another way exists do to that ?

          @mpergand Thanks for you answer.
          I got a pushbutton in my pagePrincipale to go to my MainWindow, and i got another push button in my MainWindow to go to my pagePrincipale too ;)

          jsulmJ J.HilkJ 2 Replies Last reply
          0
          • C Cervo2paille

            @Christian-Ehrlicher
            Thank you. So i can't call my QMainWindow ? Maybe another way exists do to that ?

            @mpergand Thanks for you answer.
            I got a pushbutton in my pagePrincipale to go to my MainWindow, and i got another push button in my MainWindow to go to my pagePrincipale too ;)

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Cervo2paille said in No member named X in:

            So i can't call my QMainWindow ?

            You can, but you can't call a method on an instance of a class which does not have such a method - isn't that logical?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • C Cervo2paille

              @Christian-Ehrlicher
              Thank you. So i can't call my QMainWindow ? Maybe another way exists do to that ?

              @mpergand Thanks for you answer.
              I got a pushbutton in my pagePrincipale to go to my MainWindow, and i got another push button in my MainWindow to go to my pagePrincipale too ;)

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @Cervo2paille
              your QMainWinow instance it telling you to "Go Fish".

              Nothing you can do about it. Use a QDialog or one of its derivatives.

              That said, what exactly do you want to archive here, can you describe it a bit more?


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              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