翻譯|使用教程|編輯:鮑佳佳|2020-11-30 11:49:08.700|閱讀 399 次
概述:QtitanRibbon組件實(shí)現(xiàn)了Microsoft Ribbon for Qt的概念,設(shè)計用于任何使用Qt開發(fā)的商業(yè)應(yīng)用。下文是在實(shí)際開發(fā)過程中所遇到的一些問題,及解決方法!
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
QtitanRibbon組件實(shí)現(xiàn)了Microsoft Ribbon for Qt的概念,設(shè)計用于任何使用Qt開發(fā)的商業(yè)應(yīng)用。這個組件和Qt一道為獲取一些應(yīng)用提供了一個難得的機(jī)會,這些應(yīng)用在全球三大主要平臺Windows、Linux和Mac OS X上都有現(xiàn)代化的外觀和感覺。
下文是在實(shí)際開發(fā)過程中所遇到的一些問題,及解決方法!
錯誤:動畫中QList/QTree的鼠標(biāo)懸停/點(diǎn)擊行為不正確。
平臺: 使用QTitanRibbon 5.1.0和Qt 5.13.1,64位。
Bug: 當(dāng)QListView/QTreeView控件中有可檢查的項目時,當(dāng)你將鼠標(biāo)懸停或點(diǎn)擊它們時,你會看到以下情況。
1:沒有動畫,所有行為都是正確的。
當(dāng)你啟用動畫時。
2:在win7/offfice2007/office2010風(fēng)格下,行為是錯誤的。
3:但在其他office2013/2016/photoshop中都是正確的。
所以我在controlsdemo的例子中做了一點(diǎn)改動,并用附圖驗(yàn)證了這個問題。
這是對ControlsDemo示例的mainwindow.cpp文件的修改:
#include <QTreeView> #include <QStandardItemModel> ... MainWindow::MainWindow(QWidget* parent) ... emit updateRecentFileActions(files); // Frank start here QStandardItemModel* pSourceTreeModel = new QStandardItemModel; QStringList szHeaderNameList; szHeaderNameList << "Source/Index" << "Name"; pSourceTreeModel->setHorizontalHeaderLabels(szHeaderNameList); QStandardItem* pSourceItem = new QStandardItem("Item1"); pSourceItem->setCheckable(true); pSourceItem->setTristate(false); pSourceTreeModel->appendRow(pSourceItem); pSourceItem = new QStandardItem("Item2"); pSourceItem->setCheckable(true); pSourceItem->setTristate(false); pSourceTreeModel->appendRow(pSourceItem); pSourceItem = new QStandardItem("Item3"); pSourceItem->setCheckable(true); pSourceItem->setTristate(false); pSourceTreeModel->appendRow(pSourceItem); QTreeView* treeView = new QTreeView(this); treeView->setEditTriggers(QAbstractItemView::NoEditTriggers); treeView->setModel(pSourceTreeModel); treeView->setColumnWidth(0, 250); treeView->setColumnWidth(1, 50); setCentralWidget(treeView); // Frank End here }
當(dāng)您將鼠標(biāo)懸停在項目上時,檢查狀態(tài)將更改或發(fā)生其他意外響應(yīng)。
Qt商業(yè)組件Qtitan推薦:
感謝您的閱讀,希望這篇文章能帶給你一定的幫助!如果這篇文章沒能滿足你的需求、點(diǎn)擊獲取更多文章教程!現(xiàn)在立刻下載Qt6免費(fèi)試用吧!更多Qt類開發(fā)工具QtitanRibbon、QtitanChart、QtitanNavigation、QtitanDocking、QtitanDataGrid在線訂購現(xiàn)直降1000元,歡迎咨詢慧都獲取更多優(yōu)惠>>
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn