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. How to connect signal by drug on Qt Creator signal slot editor mode?
Forum Updated to NodeBB v4.3 + New Features

How to connect signal by drug on Qt Creator signal slot editor mode?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 371 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.
  • B Offline
    B Offline
    bigbenbigben
    wrote on last edited by
    #1

    I use Qt Creator 11.0.2 installed by pacman in MinGW64.
    I tried to connect a signal such as a push button to a text label by entering the signal/slot edit mode and dragging the placed push button onto the main window, but the red arrow for signal connect does not appear.
    Is there a way to enable GUI operation in signal/slot editing mode?

    I made the test project by New Project > Application(Qt) > Qt widgets Application, and I was able to confirm that the connection was established by editing the code directly as shown below

    mainwindow.h

    public:
         MainWindow(QWidget *parent = nullptr);
         ~MainWindow();
    
    // add
    private slots: 
        void print_hello();
    
     private:
         Ui::MainWindow *ui;
    

    mainwindow.cpp

    MainWindow::~MainWindow() 
         delete ui;
     }
    
    // add  
    void MainWindow::print_hello() 
    { 
        std::cout << "hello!" << std::endl; 
    } 
    

    Windows 11 Pro 21H2
    MSYS2 (MinGW 64)
    Qt Creator 11.0.2
    mingw-w64-qt6-base 6.5.2-5

    S 1 Reply Last reply
    0
    • B bigbenbigben

      I use Qt Creator 11.0.2 installed by pacman in MinGW64.
      I tried to connect a signal such as a push button to a text label by entering the signal/slot edit mode and dragging the placed push button onto the main window, but the red arrow for signal connect does not appear.
      Is there a way to enable GUI operation in signal/slot editing mode?

      I made the test project by New Project > Application(Qt) > Qt widgets Application, and I was able to confirm that the connection was established by editing the code directly as shown below

      mainwindow.h

      public:
           MainWindow(QWidget *parent = nullptr);
           ~MainWindow();
      
      // add
      private slots: 
          void print_hello();
      
       private:
           Ui::MainWindow *ui;
      

      mainwindow.cpp

      MainWindow::~MainWindow() 
           delete ui;
       }
      
      // add  
      void MainWindow::print_hello() 
      { 
          std::cout << "hello!" << std::endl; 
      } 
      

      Windows 11 Pro 21H2
      MSYS2 (MinGW 64)
      Qt Creator 11.0.2
      mingw-w64-qt6-base 6.5.2-5

      S Offline
      S Offline
      StudentScripter
      wrote on last edited by
      #2

      @bigbenbigben hey don't know if it helps, but may have a look at this tutorial here:

      C++ Qt 4 - Signals and Slots,

      it's a little older video bei VoidRealms but still works. :)
      Best regards

      B 1 Reply Last reply
      0
      • S StudentScripter

        @bigbenbigben hey don't know if it helps, but may have a look at this tutorial here:

        C++ Qt 4 - Signals and Slots,

        it's a little older video bei VoidRealms but still works. :)
        Best regards

        B Offline
        B Offline
        bigbenbigben
        wrote on last edited by bigbenbigben
        #3

        @StudentScripter
        Thank you for your reply.

        Probably, but the problem is solved.
        For some reason in my environment, selecting buddy editting mode launches signal/slot editting mode.

        https://x.com/bigbenbigben/status/1707383342621229086?s=20

        1 Reply Last reply
        0
        • B bigbenbigben has marked this topic as solved on

        • Login

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