cplusplusqt | Unsorted

Telegram-канал cplusplusqt - C++ & Qt

1220

Link: @CplusplusQt Embedded: @EMBCpp • Allowed Topics: C++ and everything related to Qt • Use only English • No Private Message without asking user's permission • No NSFW • No Spam • No unauthorized Bots • No Offtopic • No Self Promotions

Subscribe to a channel

C++ & Qt

The point/rule is that auto can't deduce top-level const. i has a top-level const while none of s and pd has that.

Читать полностью…

C++ & Qt

I think the newish Shapes module will do that.

Читать полностью…

C++ & Qt

Oh, sorry, I have updated the link.

Читать полностью…

C++ & Qt

So without canvas how can I draw an arc tho?

Читать полностью…

C++ & Qt

Try not to use Canvas in QML if you care about your application's performance.
https://doc.qt.io/qt-6/qml-qtquick-shapes-conicalgradient.html

Читать полностью…

C++ & Qt

What are you trying to do (that can’t be done)?

Читать полностью…

C++ & Qt

Here is a html canvas version:

https://stackoverflow.com/questions/14193956/draw-arc-with-linear-gradient-in-html5-canvas

Читать полностью…

C++ & Qt

I tried adding a gradient so that when the progress is at 0 it's black and when it reaches 100 its in cyan, I used linear gradient and it's not working as I intended it to

Читать полностью…

C++ & Qt

a is S<const int> but not const S<const int>. It doesn't deduce anything there. The template was instantiated with const int, so it's const int.

q is const double * but not const double * const. It's a pointer to a constant object, but not a constant pointer.

Читать полностью…

C++ & Qt

auto in a can deduce that the type is S<const int> not S<int>, likewise in q, it can deduce the type is const double* and not double*

Читать полностью…

C++ & Qt

auto has been used for a and q with const deduced correctly without need to use const auto.

Читать полностью…

C++ & Qt

I guess what Sébastien means is that you aren't wondering why

int i = 42;

works although you initialize a mutable variable i with a constant expression 42. So, with auto it's kinda the same.

Читать полностью…

C++ & Qt

That’s like what has been written in the code above.

Читать полностью…

C++ & Qt

int j = 42; // 42 is const (event constexpr) but j is not const

Читать полностью…

C++ & Qt

template <typename T>
struct S {};

int main() {
S<const int> s;
s =
S<const int>{}; // OK
auto a = s;// type of
a is S<const int>

const int i{};
auto j = i; // type of
j is int

const double *pd {new double(3.4)};
auto q = pd; //
type of q
is const double*

//

}

Читать полностью…

C++ & Qt

https://doc.qt.io/qt-5/qml-qtquick-patharc.html

Читать полностью…

C++ & Qt

You can use a combination of MultiEffect's opacity mask and ConicalGradient.
https://doc.qt.io/qt-6/qml-qtquick-shapes-conicalgradient.html

Читать полностью…

C++ & Qt

Hi am new to qt i have some doubt how to use qface framework and how to create publisher / subscriber model is it really required IVI?

Читать полностью…

C++ & Qt

Qt Graphical Effects is deprecated in Qt6 and available as part of QtCompat module. Alrenatives are Qt MultiEffects and Shapes.

Читать полностью…

C++ & Qt

It's hard to explain but I'm just trying to mirror but the source is in a different window...actually different screen 😅

Читать полностью…

C++ & Qt

Any chance there's a workaround for this error?
ShaderEffectSource: sourceItem and ShaderEffectSource must both be children of the same window
I already have a good plan and my code makes sense but this is a deal breaker and bug report said they won't fix it 😭

Читать полностью…

C++ & Qt

This is what I'm trying to achieve

Читать полностью…

C++ & Qt

Hey I was trying to implement a circular progress bar and tried something but it's not working as intended

Читать полностью…

C++ & Qt

What you’ve mentioned are correct but yet there’s a little and subtle point remaining.

Читать полностью…

C++ & Qt

a is not const and q neither. q can point to another double.

Читать полностью…

C++ & Qt

If you need the same type on the left, use const auto explicitly or maybe decltype

Читать полностью…

C++ & Qt

I did not understand the question then

Читать полностью…

C++ & Qt

auto j = i; // j is not const, even when i is const

Читать полностью…

C++ & Qt

Kind of a challenge.

Why does auto behave differently in deducing const for j?

Читать полностью…

C++ & Qt

Hi, I need someone who can make a Tetris application in Qt

Читать полностью…
Subscribe to a channel