Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mark something in Qt as obsolete(deprecated)?

Is there Q_OBSOLETE or Q_DEPRECATED in C++ with Qt 4.7?

Or is there a similar C++ macro or keyword?

like image 845
Gad D Lord Avatar asked Nov 14 '10 20:11

Gad D Lord


2 Answers

If you use Q_DECL_DEPRECATED you should get the outcome you are looking for e.g.:

Q_DECL_DEPRECATED void foo();
like image 111
Tim Sutton Avatar answered Sep 23 '22 19:09

Tim Sutton


  1. Pull the real function out of public scope.
  2. Create another function with the same name in public scope.
  3. Insert your warning/fail code in that function.
  4. Call the original with the new.
like image 41
Edward Strange Avatar answered Sep 22 '22 19:09

Edward Strange