0
我用下面的代碼進行測試:QProgressDialog:如何調整對話框的大小以適合其內容?
QProgressDialog* dialog = new QProgressDialog("Message", "Close", 0, 10);
dialog->setWindowTitle("Long Long Long Long Title");
dialog->setCancelButtonText("Long Long Long Click this button to cancel");
dialog->setWindowModality(Qt::ApplicationModal);
dialog->adjustSize();
dialog->setValue(5);
標題和取消按鈕上的文字被切斷。我調用了adjustSize(),但它不起作用。如何調整對話框的大小以適應其內容?
使用'Layout's,選中[文件](http://doc.qt.io/qt- 5 /實例-layouts.html)。 – KernelPanic
當按鈕有這麼長的名字時,它看起來並不漂亮。您最好設置一個簡短的名稱並使用長描述作爲工具提示文本。 – vahancho
@KernelPanic,QProgressDialog由QT提供,我可以編輯它的佈局嗎? – ldlchina