答案 0 :(得分:2)
SELECT if(substr(link, 1, 2)='y_', CONCAT('https://www.youtube.com/watch?v=',substr(link,3)), CONCAT('https://vimeo.com/',substr(link,3))) as link, `title`
FROM `video`
WHERE `reg_id` = '101'
答案 1 :(得分:0)
您可以采用委托方式:
#include <QStyledItemDelegate>
class NoHighlightDelegate:public QStyledItemDelegate{
public:
void initStyleOption(QStyleOptionViewItem*option,const QModelIndex&viewIndex)const override{
QStyledItemDelegate::initStyleOption(option,viewIndex);
option->state&=~QStyle::State_MouseOver;}
};
然后将此代表设置为您的QTreeView
:
//QTreeView*view;
auto*delegate=new NoHighlightDelegate();
delegate->setParent(view);
view->setItemDelegate(delegate);
您将不会陷入隐藏的选定行问题。