Quick-Turn-Studio / CLionSupportForQt

19 stars 0 forks source link

Support camelcase functions #54

Open asztalosdani opened 2 years ago

asztalosdani commented 2 years ago

E.g. QLinearGradient is marked as error

grabusr commented 2 years ago

Hi @asztalosdani,

Could you tell what plugin gives you this error? Can you also provide a code example and link to documentation that describe this feature?

asztalosdani commented 2 years ago

It's Qt Style Sheet Highlighter Example code:

QWidget {
    background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848);
}

image

So the issue is, only the lowercase keyword is recognized, although both work in Qt.

grabusr commented 2 years ago

Hi @asztalosdani, could you provide a reference to that case insensitivity feature? We cannot find it in Qt documentation.

asztalosdani commented 2 years ago

Hi,

you can find it here: https://doc.qt.io/qt-5/stylesheet-syntax.html

Qt Style Sheet is generally case insensitive (i.e., color, Color, COLOR, and cOloR refer to the same property). The only exceptions are class names, object names, and Qt property names, which are case sensitive.

Although QLinearGradient is a class name, I think the exception refers to the widget classes. But this quote reveals that this should also work:

QWidget {
    background: qlineargradient( X1: 0, y1: 0, x2: 1, y2: 0, STOP: 0.0 #121212, stop: 0.2 #282828, stop: 1 #484848);
}

image