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. Enlazar dos ventanas
Qt 6.11 is out! See what's new in the release blog

Enlazar dos ventanas

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.9k 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.
  • E Offline
    E Offline
    Edward_SZS
    wrote on last edited by
    #1

    Good afternoon, how can I link several QDialog windows if I only have one QMainWindow, but I have already connected both qdialogs to the main one, so now I only need to run the QMainWindow (main cpp) without having to show it until I require it. Thank you.

    jsulmJ 1 Reply Last reply
    0
    • E Edward_SZS

      Good afternoon, how can I link several QDialog windows if I only have one QMainWindow, but I have already connected both qdialogs to the main one, so now I only need to run the QMainWindow (main cpp) without having to show it until I require it. Thank you.

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

      @Edward_SZS Sorry, I don't understand your description at all!
      "how can I link several QDialog windows" - what does "link" mean here?
      Can you please refrase your question and explain more clearly what you want to do?

      Also, please keep the caption of your thread in English.

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

      E 2 Replies Last reply
      0
      • jsulmJ jsulm

        @Edward_SZS Sorry, I don't understand your description at all!
        "how can I link several QDialog windows" - what does "link" mean here?
        Can you please refrase your question and explain more clearly what you want to do?

        Also, please keep the caption of your thread in English.

        E Offline
        E Offline
        Edward_SZS
        wrote on last edited by
        #3

        @jsulm me refiero a como puedo pasar con un button box de una ventana (qdialog a otra qdialog). Gracias.

        U 1 Reply Last reply
        0
        • jsulmJ jsulm

          @Edward_SZS Sorry, I don't understand your description at all!
          "how can I link several QDialog windows" - what does "link" mean here?
          Can you please refrase your question and explain more clearly what you want to do?

          Also, please keep the caption of your thread in English.

          E Offline
          E Offline
          Edward_SZS
          wrote on last edited by
          #4

          @jsulm Mi pregunta va en referencia a como hago para conectar dos ventanas que no son las principales, a su vez cree una principal para ejecutar la funciones de connect, pero quiero que en el main.cpp solo ejecute el qt application mas no lo muestre. Gracias.

          jsulmJ 1 Reply Last reply
          0
          • E Edward_SZS

            @jsulm me refiero a como puedo pasar con un button box de una ventana (qdialog a otra qdialog). Gracias.

            U Offline
            U Offline
            U7Development
            wrote on last edited by
            #5

            @Edward_SZS Hola / Hello..

            Spanish:
            Debes conectar el botón con una función miembro en el constructor:

            English:
            You need to connect the current button with a member function of your current window, do it inside constructor:

            #include "mi_otra_ventana.h"
            
            mi_ventana::mi_ventana(){
                 connect(ui->myButton, SIGNAL(clicked()), this, SLOT(onClick_myButton()));
            }
            
            //source, declaración función miembro
            void mi_ventana::onClick_myButton(){
                 mi_otra_ventana w(this);
                 int t = w.exec();
            
                  if (t == QDialog::Accepted){
                       //aquí va código en caso de que la ventana siguiente
                       //se haya cerrado al hacer clic en Aceptar (si lo tiene)
                   
                        //here goes code in case you clicked accept
            
                  }
            
            }
            
            
            //header
            private slots:
                 void onClick_myButton();
            
            1 Reply Last reply
            0
            • E Edward_SZS

              @jsulm Mi pregunta va en referencia a como hago para conectar dos ventanas que no son las principales, a su vez cree una principal para ejecutar la funciones de connect, pero quiero que en el main.cpp solo ejecute el qt application mas no lo muestre. Gracias.

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

              @Edward_SZS Please consider to use https://forum.qt.io/category/31/spanish if you want to ask in Spanish, this is English forum. I don't speak Spanish, so I can't help.

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

              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