Results 1 to 8 of 8

Thread: Communication from Framelsee Window to Framed Window

  1. #1
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    86
    Thanks
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Communication from Framelsee Window to Framed Window

    Hi,

    Here in our Application we are calling other application binary.
    In our main application we are using Qt::FramelessWindowHint i.e our parent app is framess
    and our child app is framed.

    when we trying to call child application from parent application it is not running.

    Kindly, please give solution to run application.

    source:
    Qt Code:
    1. Widget::Widget(QWidget *parent) :
    2. QWidget(parent),
    3. ui(new Ui::Widget)
    4. {
    5. setWindowFlags(Qt::FramelessWindowHint);note:this main parent window is framess.
    6.  
    7. ui->setupUi(this);
    8. }
    9. Widget::~Widget()
    10. {
    11. delete ui;
    12. }
    13. void Widget::on_pushButton_2_clicked()
    14. {
    15. this->close();
    16. }
    17. void Widget::on_pushButton_clicked()
    18. {
    19. QMessageBox msgBox(this);
    20. msgBox.setText("display a message");
    21. msgBox.setStyleSheet("background:cyan");
    22. msgBox.exec();
    23. system("/usr/bin/Gnome-Selfdiag -platform xcb "); Note:here this Gnome-Selfdiag app is framed.
    24. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by anda_skoa; 10th February 2016 at 11:00. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Communication from Framelsee Window to Framed Window

    Well, this is the code of the application that works, how does this "Gnome-Selfdiag" program set the frameless hint?

    Cheers,
    _

  3. #3
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    86
    Thanks
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Communication from Framelsee Window to Framed Window

    Hi,

    For parent we have used "setWindowFlags(Qt::FramelessWindowHint)",so this is frameless, and for Gnome-Selfdiag we haven't used this, so it is framed and when we are running this application, it is hanging and Gnome-Selfdiag application is not running.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Communication from Framelsee Window to Framed Window

    Quote Originally Posted by sanjeet View Post
    For parent we have used "setWindowFlags(Qt::FramelessWindowHint)",so this is frameless, and for Gnome-Selfdiag we haven't used this, so it is framed and when we are running this application, it is hanging and Gnome-Selfdiag application is not running.
    Ah, I misunderstood your original question. You mentioned frameless and framed as if that was important.

    Your application hangs because you are running a blocking operation (system()).

    If you want your program to continue while executing another as a child process, use QProcess.

    Cheers,
    _

  5. #5
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    86
    Thanks
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Communication from Framelsee Window to Framed Window

    Hi,

    Thanks for your support....

    Can you please give us any example.....????


    Added after 28 minutes:


    Hi,

    I tried by using QProcess also...Same problem we are facing....
    It's not working with QProcess.
    Last edited by sanjeet; 11th February 2016 at 10:22.

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Communication from Framelsee Window to Framed Window

    You forgot to post the code

    Cheers,
    _

  7. #7
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    86
    Thanks
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Communication from Framelsee Window to Framed Window

    Hi,

    My code is....
    Qt Code:
    1. Widget::Widget(QWidget *parent) :
    2. QWidget(parent),
    3. ui(new Ui::Widget)
    4. {
    5. setWindowFlags(Qt::FramelessWindowHint);
    6.  
    7. ui->setupUi(this);
    8. }
    9.  
    10. Widget::~Widget()
    11. {
    12. delete ui;
    13. }
    14.  
    15. void Widget::on_pushButton_2_clicked()
    16. {
    17. this->close();
    18. }
    19.  
    20. void Widget::on_pushButton_clicked()
    21. {
    22. QMessageBox msgBox(this);
    23. msgBox.setText("display a message");
    24. msgBox.setStyleSheet("background:cyan");
    25. msgBox.exec();
    26. QString prg="/usr/bin/Gnome-Selfdiag";
    27. QStringList arguments;
    28. arguments << "-platform" << "xcb";
    29. QProcess *myproc = new QProcess(this);
    30. // myproc->start(prg,arguments);
    31. // myproc->waitForFinished();
    32. myproc->execute(prg,arguments);
    33. // system("/usr/bin/Gnome-Selfdiag -platform xcb ");
    34. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by anda_skoa; 12th February 2016 at 10:02. Reason: missing [code] tags

  8. #8
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Communication from Framelsee Window to Framed Window

    Since you don't want to block, use QProcess::start().

    You might also want to connect to the finished() signal to get the other program's exit code and the exit status, maybe also the error() signal.

    Cheers,
    _

Similar Threads

  1. Parent and Child Window Communication
    By Harini in forum Qt Programming
    Replies: 33
    Last Post: 30th November 2013, 00:31
  2. Replies: 2
    Last Post: 14th January 2013, 07:07
  3. Replies: 6
    Last Post: 9th November 2011, 04:31
  4. Replies: 2
    Last Post: 17th February 2011, 12:30
  5. Replies: 11
    Last Post: 4th June 2008, 07:22

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.