mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Create a new blank document
This commit is contained in:
@ -15,7 +15,6 @@
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with PDFForQt. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#ifndef PDFUTILS_H
|
||||
#define PDFUTILS_H
|
||||
|
||||
@ -497,6 +496,33 @@ static inline bool isFuzzyComparedPointsSame(const QPointF& p1, const QPointF& p
|
||||
return squaredDistance < squaredTolerance;
|
||||
}
|
||||
|
||||
/// Storage for result of some operation. Stores, if operation was successful, or not and
|
||||
/// also error message, why operation has failed. Can be converted explicitly to bool.
|
||||
class PDFOperationResult
|
||||
{
|
||||
public:
|
||||
inline PDFOperationResult(bool success) :
|
||||
m_success(success)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
inline PDFOperationResult(QString message) :
|
||||
m_success(false),
|
||||
m_errorMessage(qMove(message))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
explicit operator bool() const { return m_success; }
|
||||
|
||||
const QString& getErrorMessage() const { return m_errorMessage; }
|
||||
|
||||
private:
|
||||
bool m_success;
|
||||
QString m_errorMessage;
|
||||
};
|
||||
|
||||
} // namespace pdf
|
||||
|
||||
#endif // PDFUTILS_H
|
||||
|
Reference in New Issue
Block a user