Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt 5.13 deprecated warnings #90

Closed
vadi2 opened this issue Jul 21, 2019 · 1 comment
Closed

Qt 5.13 deprecated warnings #90

vadi2 opened this issue Jul 21, 2019 · 1 comment
Assignees

Comments

@vadi2
Copy link
Contributor

vadi2 commented Jul 21, 2019

edbee-lib/edbee-lib/edbee/views/textrenderer.cpp:147:40: warning: 'width' is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
    return textWidget()->fontMetrics().width("M");
                                       ^

Qt 5.13 throws up some warnings about deprecated APIs starting with this one :)

@gamecreature gamecreature self-assigned this Aug 13, 2019
@emoon
Copy link
Contributor

emoon commented Jul 19, 2020

I'm getting a bunch of these as well. Here is a more complete (yet not all of them) list

edbee/views/textrenderer.cpp: In member function ‘int edbee::TextRenderer::emWidth()’:
edbee/views/textrenderer.cpp:151:49: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
     return textWidget()->fontMetrics().width("M");
                                                 ^
In file included from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qpainter.h:59:0,
                 from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/QPainter:1,
                 from edbee/views/textrenderer.cpp:10:
/home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qfontmetrics.h:106:9: note: declared here
     int width(const QString &, int len = -1) const;
         ^~~~~
edbee/views/textrenderer.cpp: In member function ‘int edbee::TextRenderer::nrWidth()’:
edbee/views/textrenderer.cpp:159:49: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
     return textWidget()->fontMetrics().width("8");
                                                 ^
In file included from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qpainter.h:59:0,
                 from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/QPainter:1,
                 from edbee/views/textrenderer.cpp:10:
/home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qfontmetrics.h:106:9: note: declared here
     int width(const QString &, int len = -1) const;
         ^~~~~
edbee/views/textrenderer.cpp: In member function ‘QTextLayout* edbee::TextRenderer::textLayoutForLineForPlaceholder(int)’:
edbee/views/textrenderer.cpp:257:79: warning: ‘int QFontMetrics::charWidth(const QString&, int) const’ is deprecated [-Wdeprecated-declarations]
         int tabWidth = controllerRef_->widget()->fontMetrics().charWidth("M",0);
                                                                               ^
In file included from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qpainter.h:59:0,
                 from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/QPainter:1,
                 from edbee/views/textrenderer.cpp:10:
/home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qfontmetrics.h:117:23: note: declared here
     QT_DEPRECATED int charWidth(const QString &str, int pos) const;
                       ^~~~~~~~~
edbee/views/textrenderer.cpp:260:62: warning: ‘void QTextOption::setTabStop(qreal)’ is deprecated [-Wdeprecated-declarations]
         option.setTabStop( config()->indentSize() * tabWidth );
                                                              ^
In file included from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qpainter.h:50:0,
                 from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/QPainter:1,
                 from edbee/views/textrenderer.cpp:10:
/home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qtextoption.h:158:13: note: declared here
 inline void QTextOption::setTabStop(qreal atabStop)
             ^~~~~~~~~~~
edbee/views/textrenderer.cpp: In member function ‘QTextLayout* edbee::TextRenderer::textLayoutForLineNormal(int)’:
edbee/views/textrenderer.cpp:315:79: warning: ‘int QFontMetrics::charWidth(const QString&, int) const’ is deprecated [-Wdeprecated-declarations]
         int tabWidth = controllerRef_->widget()->fontMetrics().charWidth("M",0);
                                                                               ^
In file included from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qpainter.h:59:0,
                 from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/QPainter:1,
                 from edbee/views/textrenderer.cpp:10:
/home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qfontmetrics.h:117:23: note: declared here
     QT_DEPRECATED int charWidth(const QString &str, int pos) const;
                       ^~~~~~~~~
edbee/views/textrenderer.cpp:318:62: warning: ‘void QTextOption::setTabStop(qreal)’ is deprecated [-Wdeprecated-declarations]
         option.setTabStop( config()->indentSize() * tabWidth );
                                                              ^
In file included from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qpainter.h:50:0,
                 from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/QPainter:1,
                 from edbee/views/textrenderer.cpp:10:
/home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qtextoption.h:158:13: note: declared here
 inline void QTextOption::setTabStop(qreal atabStop)
             ^~~~~~~~~~~
edbee/views/textrenderer.cpp:329:85: warning: ‘void QTextLayout::setAdditionalFormats(const QList<QTextLayout::FormatRange>&)’ is deprecated: Use setFormats() [-Wdeprecated-declarations]
         textLayout->setAdditionalFormats( themeStyler()->getLineFormatRanges( line ));
                                                                                     ^
In file included from /home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/QTextLayout:1:0,
                 from edbee/views/textrenderer.cpp:12:
/home/emoon/code/other/Qt/5.14.1/gcc_64/include/QtGui/qtextlayout.h:154:46: note: declared here
     QT_DEPRECATED_X("Use setFormats()") void setAdditionalFormats(const QList<FormatRange> &overrides);
                                              ^~~~~~~~~~~~~~~~~~~~

gamecreature added a commit that referenced this issue Jul 20, 2020
…sible incompatibility with older releases!
SlySven pushed a commit to SlySven/edbee-lib that referenced this issue Oct 27, 2020
…. Possible incompatibility with older releases!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants