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. Error message always pops up on same tab

Error message always pops up on same tab

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

    There are 3 tabs in total and each tab is associated to certain tool buttons.
    Individual tab is supposed to throw a specific UIError.

    Currently error message getting popped up in the last tab as default.

    Requirement is to have the error message pop in that specific tab.
    Any suggestions to resolve this would be of great help.
    Thanks in advance.

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

      Hi,

      Where are these errors coming from ?
      How are they associated with the tabs ?

      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
      • S Offline
        S Offline
        Shruthi
        wrote on last edited by
        #3
        This post is deleted!
        JonBJ 1 Reply Last reply
        0
        • S Shruthi

          This post is deleted!

          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by
          #4

          @Shruthi
          You are throwing an exception, and with a class of UIError. FWIW, that is your own class. In any case, it's a C++ throw, so how do you handle that, because whatever it is that's what displaying your message?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Shruthi
            wrote on last edited by
            #5

            In the window called test_window there are three tabs - tab1,tab2,tab3 and one push button called run. For example in tab2 I have checkbox followed by the lineEdit and I am validating the lineEdit field on clicking the pushbutton run. Validation for the lineEdit is user should enter values from 1-10. If not, I am raising an UIError.

            void test_window::on_pushButton_1_clicked()
            {
            validateLineEdit();
            }

            void test_window::validateLineEdit
            {
            throw UIError("Error: LineEdit",
            "The field is not in the expected range.\n" ,
            "please enter the valid value.\n");
            }

            This error should pop in tab2 itself but by default it pops to the last tab i.e., tab3
            How to pass the tab information while throwing the UIError.

            Suggestions are appreciated.
            Thank you.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Shruthi
              wrote on last edited by
              #6

              @JonB Yes. It's displaying the message correctly whatever it is. But all the errors pops to the last tab because the pushbutton is not confined to tab. It's for window.
              So, on clicking all the error defaults to last tab. How to make it specific to tab.

              Thank you so much for your reply.

              JonBJ 1 Reply Last reply
              0
              • S Shruthi

                @JonB Yes. It's displaying the message correctly whatever it is. But all the errors pops to the last tab because the pushbutton is not confined to tab. It's for window.
                So, on clicking all the error defaults to last tab. How to make it specific to tab.

                Thank you so much for your reply.

                JonBJ Online
                JonBJ Online
                JonB
                wrote on last edited by JonB
                #7

                @Shruthi
                So I don't know what code you use to display the thrown error. It apparently needs altering to do whatever it is you want to achieve.

                How to pass the tab information while throwing the UIError.

                Like I said, UIError appears to be your own class. If you want to pass the tab, change that class to accept the tab, and use it for the message.

                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