我用的是 QT3 想獲得textedit中游標的位置,即得到游標所在的行數和列數,查了檔案,覺得只有QTextEdit::textCursor () 可用,可是不知道怎么 用??編譯時出錯提示其是proteced ,麻煩有知道怎么做的提示一下,或者還有別的辦法??不勝感激,謝謝
uj5u.com熱心網友回復:
版主大人,幫幫忙啊,我實在是沒轍了uj5u.com熱心網友回復:
各路高手,請幫忙啊uj5u.com熱心網友回復:
class A{public:protected: int textCursor() const { return i; }private: int i;};class B : public A{public: int textCursor() const { return A::textCursor(); } };int main(int argc, char *argv[]){ B b; int i = b.textCursor(); return 0;}利用這種方法繼承QTextEdit的textCursor函式uj5u.com熱心網友回復:
在QT3里面沒找到QTextCursor 這個類,而這個函式的回傳型別是QTextCursor型別,怎么用呢uj5u.com熱心網友回復:
問答周期近一年了,而且我也不會轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/13258.html
標籤:其他技術討論專區
下一篇:“等等黨”們,你們要的特惠來啦!
