habe folgenden Code (mit designer erstellt);
alle componenten lassen sich anzeigen, auch im fertigen Programm.
Allerdings sind in der Preview wie auch in der EXE die ScrollBars deactiviert und somit kann man das EditFenster nicht verschieben
Wie macht man es richtig?
Danke für Code und Hilfe
Jens
Code: Alles auswählen
scrollArea = new QScrollArea(designer);
scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
scrollArea->setGeometry(QRect(0, 0, 331, 281));
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(scrollArea->sizePolicy().hasHeightForWidth());
scrollArea->setSizePolicy(sizePolicy);
scrollArea->viewport()->setProperty("cursor", QVariant(QCursor(Qt::UpArrowCursor)));
scrollArea->setFocusPolicy(Qt::ClickFocus);
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scrollArea->setWidgetResizable(false);
scrollArea->horizontalScrollBar()->setRange(0,600);
scrollAreaWidgetContents = new QWidget();
scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
scrollAreaWidgetContents->setGeometry(QRect(0, 0, 312, 262));
plainTextEdit = new QPlainTextEdit(scrollAreaWidgetContents);
plainTextEdit->setObjectName(QString::fromUtf8("plainTextEdit"));
plainTextEdit->setGeometry(QRect(150, 40, 241, 181));
label = new QLabel(scrollAreaWidgetContents);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(290, 240, 46, 13));
scrollArea->setWidget(scrollAreaWidgetContents);