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. QMessageBox Dont work
Forum Updated to NodeBB v4.3 + New Features

QMessageBox Dont work

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 739 Views 3 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.
  • Lays147L Offline
    Lays147L Offline
    Lays147
    wrote on last edited by
    #1

    hi guys!
    I'm trying to call a msgbox like that:

    msg.setText("Parada de Emergência Selecionada: Aguarde 1 min");
           msg.setIcon(QMessageBox::Critical);
           msg.setModal(true);
           msg.show();
           this->printer_object->scramPrinter();
           msg.accept();
    

    Because i need that the message on the screen when the this->printer_object->scramPrinter(); is running.
    But when the msg shows, the dialog is black. Can anyone tell's me whats wrong?

    Lays Rodrigues
    Newby on Qt - Learning always!
    Using QT 5.7
    ArchLinux

    K 1 Reply Last reply
    0
    • Lays147L Lays147

      hi guys!
      I'm trying to call a msgbox like that:

      msg.setText("Parada de Emergência Selecionada: Aguarde 1 min");
             msg.setIcon(QMessageBox::Critical);
             msg.setModal(true);
             msg.show();
             this->printer_object->scramPrinter();
             msg.accept();
      

      Because i need that the message on the screen when the this->printer_object->scramPrinter(); is running.
      But when the msg shows, the dialog is black. Can anyone tell's me whats wrong?

      K Offline
      K Offline
      kumararajas
      wrote on last edited by
      #2

      @Lays147

      How about you check the condition first and then show the message?

      Example:

             if (this->printer_object->scramPrinter())
            // I dont know what this function returns. But as per my assumption, if this is running then it shall return a bool value?
      {
             msg.setText("Parada de Emergência Selecionada: Aguarde 1 min");
             msg.setIcon(QMessageBox::Critical);
             msg.setModal(true);
             msg.show();
             msg.accept();
      }
      

      --Kumar

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        What does scramPrinter do ? If it's something blocking then it's normal that your dialog doesn't who anything, it might just have the time to get shown and then the event loop is getting blocked by scramPrinter thus no update happens anymore

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - 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