请问下qt的有关问题

请教下qt的问题
void MyInputPanelContext::sendCharacter(QChar character)
{
    QPointer<QWidget> w = focusWidget();

    if (!w)
        return;

    QKeyEvent keyPress(QEvent::KeyPress, character.unicode(), Qt::NoModifier, QString(character));
    QApplication::sendEvent(w, &keyPress);

    if (!w)
        return;

    QKeyEvent keyRelease(QEvent::KeyPress, character.unicode(), Qt::NoModifier, QString());
    QApplication::sendEvent(w, &keyRelease);
}

上面的 QPointer<QWidget> w = focusWidget();一句那个<QWidget>表示什么呢,这是c++语法吗?
 QKeyEvent keyPress(QEvent::KeyPress, character.unicode(), Qt::NoModifier, QString(character));这也是c++语法吗?QKeyEvent 是一个类,后面是什么????
------解决思路----------------------
你对C++中的如下常规用法熟悉么?

std::shared_ptr<MyClass> object;

int number(0);
------解决思路----------------------
这个不是qt问题,请先学习C++语法。
------解决思路----------------------
你知道前向声明不?
------解决思路----------------------
引用:
这个不是前向声明么?
Quote: 引用:

Quote: 引用:

你知道前向声明不?
这个是前向声明吗?



int a(0);

等价于

int a=0;

这能是前者声明么?
------解决思路----------------------
引用:
Quote: 引用:

你知道前向声明不?
QChar chr = qvariant_cast<QChar>(w->property("buttonValue"));那个qvariant_cast是什么啊,不好意思啊,c++基础有点差,麻烦指点一下


先去补补C++的基础吧
------解决思路----------------------
好吧, 没注意看参数。。。
引用:
Quote: 引用:

Quote: 引用:

你知道前向声明不?
QChar chr = qvariant_cast<QChar>(w->property("buttonValue"));那个qvariant_cast是什么啊,不好意思啊,c++基础有点差,麻烦指点一下


先去补补C++的基础吧

------解决思路----------------------
楼主C++基础确实稍差了点,第一个问题呢,你得去了解所谓的模板(template)类
第二个问题呢,QKeyEvent是class,keyRelease是实例化出来的object这个都是最基础的c++知识,说实话,非常基础。