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. problem with messageBox

problem with messageBox

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 5 Posters 627 Views 2 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I wrote:

      QMessageBox::StandardButton Mess = QMessageBox::question(classe_main, "Spazio Esaurito su Disco","Vuoi cancellare questo file?",
                                                                 QMessageBox::Yes | QMessageBox::No);
    
        if (Mess == QMessageBox::Yes)
    
        {
    
            QString path_dir = path_da_usare;
            QDir dir(path_dir);
            dir.removeRecursively();
    
        }
    
        else
        {
            //_uimainWindowobj->Info->setText("FILE NON CANCELLATO");
        }
    

    but it tells "the inferior stopped because..." but I don't know why, if I remove the messageBox is ok

    A 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Check if

      QMessageBox::StandardButton Mess = QMessageBox::question(this, "Spazio Esaurito su Disco","Vuoi cancellare questo file?",QMessageBox::Yes | QMessageBox::No);
          if (Mess == QMessageBox::Yes)  { }
          else {}
      

      Also crashes. Im pretty sure its something else in code.

      1 Reply Last reply
      1
      • Pradeep P NP Offline
        Pradeep P NP Offline
        Pradeep P N
        wrote on last edited by
        #3

        Hi @vale88

        Can you please check the QMessageBox::Yes code.

                QString path_dir = path_da_usare;
                QDir dir(path_dir);
                dir.removeRecursively();
        

        This removes (delets) everything.
        Other than that code looks fine.

        Pradeep Nimbalkar.
        Upvote the answer(s) that helped you to solve the issue...
        Keep code clean.

        ? 1 Reply Last reply
        1
        • Pradeep P NP Pradeep P N

          Hi @vale88

          Can you please check the QMessageBox::Yes code.

                  QString path_dir = path_da_usare;
                  QDir dir(path_dir);
                  dir.removeRecursively();
          

          This removes (delets) everything.
          Other than that code looks fine.

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          @Pradeep-P-N yes I use it to delete a path..but the messageBox crashes and I don't know why..

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

            Hi,

            Wath does the crash stack trace tell you ?

            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
            1
            • ? A Former User

              I wrote:

                QMessageBox::StandardButton Mess = QMessageBox::question(classe_main, "Spazio Esaurito su Disco","Vuoi cancellare questo file?",
                                                                           QMessageBox::Yes | QMessageBox::No);
              
                  if (Mess == QMessageBox::Yes)
              
                  {
              
                      QString path_dir = path_da_usare;
                      QDir dir(path_dir);
                      dir.removeRecursively();
              
                  }
              
                  else
                  {
                      //_uimainWindowobj->Info->setText("FILE NON CANCELLATO");
                  }
              

              but it tells "the inferior stopped because..." but I don't know why, if I remove the messageBox is ok

              A Offline
              A Offline
              anil_arise
              wrote on last edited by
              #6

              @vale88 try simple

              int Mess = QMessageBox::question(this, "Spazio Esaurito su Disco","Vuoi cancellare questo file?",QMessageBox::Yes | QMessageBox::No);
              if (Mess == QMessageBox::Yes) { }
              else {}

              1 Reply Last reply
              1

              • Login

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