LCL Components und Qt5 Widget

Alles rund um die Programmierung mit Qt
Antworten
paule22
Beiträge: 18
Registriert: 1. August 2010 21:25

LCL Components und Qt5 Widget

Beitrag von paule22 »

Hallo,

ich habe folgenden Code.
Leider funktioniert er nicht richtig.
Ich möchte gerne auf ein C++ Qt5 Widget eine Lazarus Pascal Komponente wie zum Beispiel TButton unterbringen.
Wie macht man das richtiger?
Danke für Rückmeldung

Code: Alles auswählen

function get_widget(win: HWND): LongInt;
var
    myTFrame: TFrame;
    btn1: TButton;
    myCTRL: TForm;
begin
writeln('start');
    myCTRL := TForm.CreateParented(win);
writeln('CTRL created');
    with myCTRL do
    begin
        top := 20;
        left := 20;
        width := 400;
        height := 500;
//        visible := true;
    end;
writeln('button:1');
    btn1 := TButton.Create(myCTRL);
    btn1.Parent := myCTRL;
    with btn1 do
    begin
        top := 70;
        left := 70;
        width := 100;
        height := 46;
        caption := 'jens';
        visible := true;
    end;
    result := 0;
end;


----------------------------------

extern "C" int get_widget(int win);
int initrd(int win)
{
	int w = get_widget(win);
	return w;
}

int main(int argc, char **argv)
{
	QApplication app(argc,argv);

	QWidget *w = new QWidget;
	w->show();
	printf("--> %d, %d\n",w->winId(),w->effectiveWinId());
	int hw = initrd(w->winId());

	return app.exec();
}


------------------------------------

# ./app
Qt: Session management error: None of the authentication protocols specified are supported
--> 44040198, 44040198
start
CTRL created
button:1
Segfault
# 
Antworten