Home > Back-end >  But it won't trigger QT5 VS2015 button binding groove function
But it won't trigger QT5 VS2015 button binding groove function

Time:12-15

# include "mainwindow. H"
# include "ui_mainwindow. H"

MainWindow: : MainWindow (QWidget * parent) :
QMainWindow (parent),
UI (new UI: : MainWindow)
{
The UI - & gt; SetupUi (this);
The connect (UI - & gt; PushButton, SIGNAL (clicked ()), and this, SLOT (on_pushButton_clicked ()));
}

MainWindow: : ~ MainWindow ()
{
Delete the UI;
}

Void MainWindow: : on_pushButton_clicked ()
{

QComboBox * cbb_1=new QComboBox (this);
Cbb_1 - & gt; The view () - & gt; SetFixedWidth (100);
Cbb_1 - & gt; SetGeometry (the rect (.) (x) + 200, the rect () () y + 10100, 30);
For (int I; i<20; I++) {
Cbb_1 - & gt; AddItem (QString: : asprintf (" Item % d ", I));
}

}


I don't know what went wrong
  • Related