24 template<Relativity R>
40 explicit Pos (qreal x, qreal y)
45 auto operator<=> (
const Pos&)
const =
default;
47 template<
typename Self>
51 return Self { 0,
self.P_.y () };
54 template<
typename Self>
58 return Self {
self.P_.x (), 0 };
61 template<
typename Self>
63 Self
Shifted (
this const Self&
self, qreal dx, qreal dy)
65 return Self {
self.P_ +
Type { dx, dy } };
73 template<
typename Self>
76 return Self { p1.P_ + p2.P_ };
79 template<
typename Self>
82 return Self { p1.P_ - p2.P_ };
85 template<
typename Self>
88 return Self { p.P_ * factor };
91 template<
typename Self>
94 return Self { p.P_ / factor };
99 return P_.x () >= p.
P_.x () &&
P_.y () >= p.
P_.y ();
104 return P_.x () <= p.
P_.x () &&
P_.y () <= p.
P_.y ();
108 template<Relativity R>
129 auto operator<=> (
const Rect&)
const =
default;
135 return P {
R_.topLeft () };
140 P BottomRight ()
const 142 return P {
R_.bottomRight () };
162 return R_.isEmpty ();
165 template<
typename Self>
168 return Self { r1.R_ | r2.R_ };
171 template<
typename Self>
174 return Self { r1.R_ & r2.R_ };
178 struct PageRelativePosBase;
179 struct PageAbsolutePosBase;
224 template<
typename Target,
typename SrcPos,
typename TargetPos,
typename Source,
typename Ctx>
225 Target
Convert (TargetPos (SrcPos::*posConvert) (Ctx)
const,
const Source& src,
const auto& context)
229 (src.template TopLeft<SrcPos> ().*posConvert) (context),
230 (src.template BottomRight<SrcPos> ().*posConvert) (context)
246 template<LC::Monocle::Relativity R>
247 class QTypeInfo<
LC::Monocle::Pos<R>> :
public QTypeInfo<QPointF> {};
249 template<LC::Monocle::Relativity R>
250 class QTypeInfo<
LC::Monocle::Rect<R>> :
public QTypeInfo<QRectF> {};
253 class QTypeInfo<
LC::Monocle::PageRelativePosBase> :
public QTypeInfo<QPointF> {};
255 class QTypeInfo<
LC::Monocle::PageAbsolutePosBase> :
public QTypeInfo<QPointF> {};
258 class QTypeInfo<
LC::Monocle::PageRelativeRectBase> :
public QTypeInfo<QRectF> {};
260 class QTypeInfo<
LC::Monocle::PageAbsoluteRectBase> :
public QTypeInfo<QRectF> {};
bool BothLeqThan(Pos p) const
Target Convert(TargetPos(SrcPos::*posConvert)(Ctx) const, const Source &src, const auto &context)
bool BothGeqThan(Pos p) const
Self operator*(this Self p, qreal factor)
requires(P::Relativity==R) P BottomRight() const
PageRelativePosBase ToPageRelative(QSizeF) const
requires(P::Relativity==R) P TopLeft() const
PageAbsoluteRectBase ToPageAbsolute(QSizeF) const
Self operator/(this Self p, qreal factor)
PageRelativeRectBase ToPageRelative(QSizeF) const
Self operator-(this Self p1, Self p2)
PageAbsolutePosBase ToPageAbsolute(QSizeF) const
Rect(Pos< R > topLeft, Pos< R > bottomRight)
Self operator &(this const Self &r1, const Self &r2)
Self Shifted(this const Self &self, qreal dx, qreal dy)
auto ClearedX(this const Self &self)
Self operator+(this Self p1, Self p2)
auto ClearedY(this const Self &self)
Self operator|(this const Self &r1, const Self &r2)