我正在尝试为我的Manjaro靴子(一个Arch发行版)编译一个窗口装饰,并且出现此错误:
/home/ldoney/material-decoration-bt/src/CloseButton.cc: In constructor ‘Material::CloseButton::CloseButton(Material::Decoration*, QObject*)’:
/home/ldoney/material-decoration-bt/src/CloseButton.cc:34:55: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
34 | auto *decoratedClient = decoration->client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decorationbutton.h:27,
from /usr/include/KDecoration2/KDecoration2/DecorationButton:1,
from /home/ldoney/material-decoration-bt/src/CloseButton.h:21,
from /home/ldoney/material-decoration-bt/src/CloseButton.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/CloseButton.cc: In member function ‘QColor Material::CloseButton::backgroundColor() const’:
/home/ldoney/material-decoration-bt/src/CloseButton.cc:87:53: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
87 | auto *decoratedClient = deco->client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decorationbutton.h:27,
from /usr/include/KDecoration2/KDecoration2/DecorationButton:1,
from /home/ldoney/material-decoration-bt/src/CloseButton.h:21,
from /home/ldoney/material-decoration-bt/src/CloseButton.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/CloseButton.cc:95:53: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
95 | auto *decoratedClient = deco->client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decorationbutton.h:27,
from /usr/include/KDecoration2/KDecoration2/DecorationButton:1,
from /home/ldoney/material-decoration-bt/src/CloseButton.h:21,
from /home/ldoney/material-decoration-bt/src/CloseButton.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/MinimizeButton.cc: In constructor ‘Material::MinimizeButton::MinimizeButton(Material::Decoration*, QObject*)’:
/home/ldoney/material-decoration-bt/src/MinimizeButton.cc:37:55: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
37 | auto *decoratedClient = decoration->client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decorationbutton.h:27,
from /usr/include/KDecoration2/KDecoration2/DecorationButton:1,
from /home/ldoney/material-decoration-bt/src/MinimizeButton.h:21,
from /home/ldoney/material-decoration-bt/src/MinimizeButton.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/MaximizeButton.cc: In constructor ‘Material::MaximizeButton::MaximizeButton(Material::Decoration*, QObject*)’:
/home/ldoney/material-decoration-bt/src/MaximizeButton.cc:37:55: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
37 | auto *decoratedClient = decoration->client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decorationbutton.h:27,
from /usr/include/KDecoration2/KDecoration2/DecorationButton:1,
from /home/ldoney/material-decoration-bt/src/MaximizeButton.h:21,
from /home/ldoney/material-decoration-bt/src/MaximizeButton.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/Decoration.cc: In member function ‘virtual void Material::Decoration::paint(QPainter*, const QRect&)’:
/home/ldoney/material-decoration-bt/src/Decoration.cc:109:43: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
109 | auto *decoratedClient = client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decoration.h:28,
from /usr/include/KDecoration2/KDecoration2/Decoration:1,
from /home/ldoney/material-decoration-bt/src/Decoration.h:21,
from /home/ldoney/material-decoration-bt/src/Decoration.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/Decoration.cc: In member function ‘virtual void Material::Decoration::init()’:
/home/ldoney/material-decoration-bt/src/Decoration.cc:122:43: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
122 | auto *decoratedClient = client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decoration.h:28,
from /usr/include/KDecoration2/KDecoration2/Decoration:1,
from /home/ldoney/material-decoration-bt/src/Decoration.h:21,
from /home/ldoney/material-decoration-bt/src/Decoration.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/Decoration.cc: In member function ‘void Material::Decoration::updateTitleBar()’:
/home/ldoney/material-decoration-bt/src/Decoration.cc:202:43: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
202 | auto *decoratedClient = client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decoration.h:28,
from /usr/include/KDecoration2/KDecoration2/Decoration:1,
from /home/ldoney/material-decoration-bt/src/Decoration.h:21,
from /home/ldoney/material-decoration-bt/src/Decoration.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/Decoration.cc: In member function ‘void Material::Decoration::paintFrameBackground(QPainter*, const QRect&) const’:
/home/ldoney/material-decoration-bt/src/Decoration.cc:297:49: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
297 | const auto *decoratedClient = client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decoration.h:28,
from /usr/include/KDecoration2/KDecoration2/Decoration:1,
from /home/ldoney/material-decoration-bt/src/Decoration.h:21,
from /home/ldoney/material-decoration-bt/src/Decoration.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/Decoration.cc: In member function ‘QColor Material::Decoration::titleBarBackgroundColor() const’:
/home/ldoney/material-decoration-bt/src/Decoration.cc:317:49: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
317 | const auto *decoratedClient = client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decoration.h:28,
from /usr/include/KDecoration2/KDecoration2/Decoration:1,
from /home/ldoney/material-decoration-bt/src/Decoration.h:21,
from /home/ldoney/material-decoration-bt/src/Decoration.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/Decoration.cc: In member function ‘QColor Material::Decoration::titleBarForegroundColor() const’:
/home/ldoney/material-decoration-bt/src/Decoration.cc:331:49: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
331 | const auto *decoratedClient = client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decoration.h:28,
from /usr/include/KDecoration2/KDecoration2/Decoration:1,
from /home/ldoney/material-decoration-bt/src/Decoration.h:21,
from /home/ldoney/material-decoration-bt/src/Decoration.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/Decoration.cc: In member function ‘void Material::Decoration::paintTitleBarBackground(QPainter*, const QRect&) const’:
/home/ldoney/material-decoration-bt/src/Decoration.cc:342:49: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
342 | const auto *decoratedClient = client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decoration.h:28,
from /usr/include/KDecoration2/KDecoration2/Decoration:1,
from /home/ldoney/material-decoration-bt/src/Decoration.h:21,
from /home/ldoney/material-decoration-bt/src/Decoration.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
/home/ldoney/material-decoration-bt/src/Decoration.cc: In member function ‘void Material::Decoration::paintCaption(QPainter*, const QRect&) const’:
/home/ldoney/material-decoration-bt/src/Decoration.cc:355:49: error: ‘T* QWeakPointer<T>::data() const [with T = KDecoration2::DecoratedClient]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Werror=deprecated-declarations]
355 | const auto *decoratedClient = client().data();
| ^
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
from /usr/include/qt/QtCore/qpointer.h:43,
from /usr/include/qt/QtCore/QPointer:1,
from /usr/include/KDecoration2/kdecoration2/decoration.h:28,
from /usr/include/KDecoration2/KDecoration2/Decoration:1,
from /home/ldoney/material-decoration-bt/src/Decoration.h:21,
from /home/ldoney/material-decoration-bt/src/Decoration.cc:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h:565:8: note: declared here
565 | T *data() const noexcept { return internalData(); }
| ^~~~
cc1plus: all warnings being treated as errors
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/materialdecoration.dir/build.make:109: src/CMakeFiles/materialdecoration.dir/CloseButton.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/CMakeFiles/materialdecoration.dir/build.make:148: src/CMakeFiles/materialdecoration.dir/MinimizeButton.cc.o] Error 1
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/materialdecoration.dir/build.make:135: src/CMakeFiles/materialdecoration.dir/MaximizeButton.cc.o] Error 1
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/materialdecoration.dir/build.make:122: src/CMakeFiles/materialdecoration.dir/Decoration.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:175: src/CMakeFiles/materialdecoration.dir/all] Error 2
make: *** [Makefile:161: all] Error 2
我相信问题与我拥有的qt版本有关,并且我安装了以下软件包:cmake extra-cmake-modules kdecoration qt5-declarative qt5-x11extras
This is the window decoration's github
我是否缺少包裹?是否有过期的包装或窗户装饰本身已过期?按照惯例,请告诉我是否缺少您需要帮助的重要信息。谢谢!
客户端方法返回一个QWeakPointer
,该QWeakPointer
具有用于访问指针的data()
方法,但现在已弃用,解决方案是更改:
data()
to
foo->client().data()
我已经创建了应用该更改的项目的foo->client().toStrongRef().data()
,因此您可以使用它:
fork
或将以下修补程序应用于原始存储库:
git clone https://github.com/eyllanesc/material-decoration-bt.git
cd material-decoration-bt; bash setup.sh