Skip to content
  • 0 Votes
    7 Posts
    2k Views
    Sh1gsS

    @SGaist

    Ok, after fiddling around with debugging and testing things, I believe I have solved it. So my thought process was the user inputs an IP Address 123.123.123.123 and before closing the popup numberpad, clicks on the different LineEdits to change the IP Mask 123.15.16.5. That is why I was checking if(num->isVisible()) because then it would close/delete/popup each time a LineEdit is clicked. I was having problems/segmentation faults because after the user clicks "Done" (or presses Enter/Return on the keyboard), the popup is deleted so checking isVisible()) resulted in errors.

    To fix this, I created a boolean value numVis that is true if the numberpad is visible, and false otherwise. It is this value that I am now checking and everything seems to work just fine. I hope this makes sense.

    I will go ahead and mark this as solved.

  • 0 Votes
    13 Posts
    4k Views
    Sh1gsS

    @mrjj

    I've changed it to check if it's in the first edit, to stop the timer so it'd look like

    123.___.___.___

    And then the user will have to manually hit "Delete" repeatedly to delete the characters. This way, the program doesn't crash. It's not exactly elegant, but it's close enough to the requirements I was given.

    I have also changed that curEdit->installEventFilter(this) is only called once.

    Thank you very much for your help, I will go ahead and mark this as solved.

  • 0 Votes
    3 Posts
    2k Views
    Sh1gsS

    Thank you @jsulm, I thought I read the documentation through, but apparently not. Also, I'm not calling QFrame. I saw the link I posted and used it as more of a guideline to create an IP Editor for my needs. Thank you for your help :)

  • 0 Votes
    7 Posts
    3k Views
    EddyE

    Thanks for posting your solution.

    Happy coding.