久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

僅使 QTreeWidgetItem 的一列可編輯

Making only one column of a QTreeWidgetItem editable(僅使 QTreeWidgetItem 的一列可編輯)
本文介紹了僅使 QTreeWidgetItem 的一列可編輯的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我有一個(gè)帶有兩列數(shù)據(jù)的 QTreeWidgetItem,有什么辦法可以只編輯第二列?當(dāng)我執(zhí)行以下操作時(shí):

I have a QTreeWidgetItem with two columns of data, is there any way to make only the second column editable? When I do the following:

QTreeWidgetItem* item = new QTreeWidgetItem();
item->setFlags(item->flags() | Qt::ItemIsEditable);

所有列都可以編輯.

推薦答案

看起來(lái)你將不得不放棄使用 QTreeWidgetQTreeWidgetItem 而使用 QTreeViewQAbstractItemModel.Widget"類(lèi)是便利類(lèi),它們是更抽象但更靈活版本的具體實(shí)現(xiàn).QAbstractItemModel 有一個(gè)調(diào)用 flags(QModelIndex index),您可以在其中為您的列返回適當(dāng)?shù)闹?

Looks like you will have to forgo using QTreeWidget and QTreeWidgetItem and go with QTreeView and QAbstractItemModel. The "Widget" classes are convenience classes that are concrete implementations of the more abstract but more flexible versions. QAbstractItemModel has a call flags(QModelIndex index) where you would return the appropriate value for your column.

這篇關(guān)于僅使 QTreeWidgetItem 的一列可編輯的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數(shù)據(jù)?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫(xiě) for() 循環(huán): for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環(huán)?)
Reusing thread in loop c++(在循環(huán) C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環(huán)形?)
主站蜘蛛池模板: 日韩欧美国产一区二区三区 | 成人国产综合 | 欧美一级黄色免费 | 欧美日韩在线一区 | 久久久久亚洲 | 免费99精品国产自在在线 | av毛片| 国产超碰人人爽人人做人人爱 | 成人免费看黄网站在线观看 | 懂色中文一区二区在线播放 | 久久四虎 | 黄色免费网站在线看 | 欧美一区二区小视频 | 国产亚洲精品久久久久动 | 特黄特黄a级毛片免费专区 av网站免费在线观看 | 亚洲高清一区二区三区 | 欧美v片 | 影音先锋男 | 国产免费一区二区三区 | 欧美一级在线观看 | 日韩伦理一区二区 | 午夜视频在线免费观看 | 久久精品国产亚洲一区二区 | 亚洲欧美另类在线 | 日韩精品免费视频 | 91免费在线 | 久久久久久久久久久久久9999 | 亚洲 欧美 日韩在线 | 国产精品毛片 | 中文字幕蜜臀 | 国产成人精品午夜 | 免费一级网站 | 久久天堂| 成年视频在线观看福利资源 | 91xxx在线观看 | 午夜丁香视频在线观看 | 亚洲精品粉嫩美女一区 | 久久亚洲精品国产精品紫薇 | 国产欧美一级二级三级在线视频 | 欧美高清视频一区 | 成人午夜精品 |