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. New window going behind the previous window when clicked

New window going behind the previous window when clicked

Scheduled Pinned Locked Moved Unsolved General and Desktop
new windowhidebehind initialby cursor
4 Posts 3 Posters 1.2k 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.
  • L Offline
    L Offline
    Lasith
    wrote on 12 Oct 2017, 12:28 last edited by Lasith 10 Dec 2017, 12:32
    #1

    In my QT c++ app I create instances(3 in this scenario) of another window(Dialog) when a button int the MainWindow is released! The Dialog window also has a button and when its clicked a QStringList is to be sent to the initial window(MainWIndow)

    following is my code

    void MainWindow::receiveFIelds(QStringList a) {
    List=a;

    }

    void MainWIndow::on_pushButton_3_clicked()
    {

       for(int i=0;i<3;i++){
       Dialog *dialog1 = new Dialog();
    
      connect(dialog1,SIGNAL(sendFields(QStringList)),this,SLOT(receiveFields(QStringList)));
    
    
       dialog1->show();
       }
    

    }

    The code of Dialog is as follows!

    void Dialog::accept() {
    QStringList info;
    info<<"I"<<"am"<<"john";
    emit sendFields( info); // here we emit the signal
    QDialog::accept();/
    }
    When the Dialog window is created and the button in it is clicked the QStringList is to be sent to the initial MainWindow but when the mouse cursor goes over the DIalog window it hides behind the main window!
    How can I correct this?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 12 Oct 2017, 19:50 last edited by
      #2

      Hi,

      What version of Qt ?
      On what OS ?
      Are you doing anything with for example focus related events in your application ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply 13 Oct 2017, 03:13
      0
      • S SGaist
        12 Oct 2017, 19:50

        Hi,

        What version of Qt ?
        On what OS ?
        Are you doing anything with for example focus related events in your application ?

        L Offline
        L Offline
        Lasith
        wrote on 13 Oct 2017, 03:13 last edited by
        #3

        @SGaist QT 5.9 in windows 10! I doubt whether there is some connection between the mainwindow being a QDialog and the dialog form being QDialog can have an impact on this?

        J 1 Reply Last reply 13 Oct 2017, 04:21
        0
        • L Lasith
          13 Oct 2017, 03:13

          @SGaist QT 5.9 in windows 10! I doubt whether there is some connection between the mainwindow being a QDialog and the dialog form being QDialog can have an impact on this?

          J Online
          J Online
          jsulm
          Lifetime Qt Champion
          wrote on 13 Oct 2017, 04:21 last edited by
          #4

          @Lasith Why is your main window a dialog? How do you show main window? If you use exec() then it is a modal window.

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

          1 Reply Last reply
          1

          2/4

          12 Oct 2017, 19:50

          • Login

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