---
title: "&QComboBox::currentIndexChanged无法用于connect"
author: "johnsmith9th"
date: "2022-07-20T15:25:13Z"
tags: []
categories: ["编程语言"]
slug: "qcombobox-currentindexchanged-connect"
draft: false
lastmod: "2022-07-20T15:25:13Z"
id: 2537880
url: "https://johnsmith9th.iteye.com/blog/2537880"
---

改为如下

QObject::connect(comboBox,QOverload&lt;int&gt;::of(&[QComboBox](/admin/blogs/qcombobox.html#QComboBox)::currentIndexChanged),\[](int index){

   qDebug() &lt;&lt; "you clicked item" &lt;&lt; index &lt;&lt; "!";

});