Giter Club home page Giter Club logo

Comments (4)

Skycoder42 avatar Skycoder42 commented on July 22, 2024 1

You do have a point. I also just realised that this would change the way the path property would behave, and I would like to avoid that.

So instead, we could either:

  1. Change the method to take an optional argument, as already suggested by you: QString QPathEdit::path(bool queryInvalid = false) const. This would not change default behaviour, since the argument is defaulted.
  2. Add a new method for this purpouse: QString QPathEdit::editPath() const. This would return the path as currently visible in the text edit, no matter it's validity.

I personally would prefer the 2. variant, as we could keep binary compability this way. Also I personally think having two seperate methods makes it clearer how the result of the two could differ.

from qpathedit.

Skycoder42 avatar Skycoder42 commented on July 22, 2024

I totally agree with you. I would suggest a method like this: QString QPathEdit::path(bool *pathValid = nullptr) const. Feel free to create a pull request with that change if you want to get it done quickly.

from qpathedit.

martonmiklos avatar martonmiklos commented on July 22, 2024

Ok, but what is the point behind the pointer argument type? The validity of the returned path could be checked by checking the emptiness of the returned path or the bool hasAcceptableInput() method could be used for this purpose as well.

from qpathedit.

martonmiklos avatar martonmiklos commented on July 22, 2024

I prefer the 2. variant too, PR submitted.

from qpathedit.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.