Hi All,
use Qt Creator 4.7 , didn't use designer, a dockwidget has several filters, Segment fault when complied,codes as below:
dockWidget = new QDockWidget(this);
dockWidget->setObjectName(QString::fromUtf8("dockWidget"));
dockWidgetContents = new QWidget();
dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetConten ts"));
gridLayout = new QGridLayout(dockWidgetContents);
gridLayout->setSpacing(6);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
horizontalLayout_2 = new QHBoxLayout();//Segment fault
horizontalLayout_2->setSpacing(6);
horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout _2"));
time_dateEdit = new QDateEdit(dockWidgetContents);
time_dateEdit->setObjectName(QString::fromUtf8("time_dateEdit")) ;
horizontalLayout_2->addWidget(time_dateEdit);
horizontalSpacer_2 = new QSpacerItem(18, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_2->addItem(horizontalSpacer_2);
lcdNumber = new QLCDNumber(dockWidgetContents);
lcdNumber->setObjectName(QString::fromUtf8("lcdNumber"));
horizontalLayout_2->addWidget(lcdNumber);
gridLayout->addLayout(horizontalLayout_2, 0, 0, 1, 1);
horizontalLayout = new QHBoxLayout();//segment fault
horizontalLayout->setSpacing(6);
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout "));
horizontalSlider = new QSlider(dockWidgetContents);
horizontalSlider->setObjectName(QString::fromUtf8("horizontalSlider "));
horizontalSlider->setOrientation(Qt::Horizontal);
horizontalLayout->addWidget(horizontalSlider);
openBtn = new QPushButton(dockWidgetContents);
openBtn->setObjectName(QString::fromUtf8("openfileBtn")) ;
horizontalLayout->addWidget(openfileBtn);
preBtn = new QPushButton(dockWidgetContents);
preBtn->setObjectName(QString::fromUtf8("preBtn"));
horizontalLayout->addWidget(preBtn);
gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1);
dockWidget->setWidget(dockWidgetContents);
Please give me any advice!
TKS.
ken
Bookmarks