10-05-2012 11:20 AM
oh, well if you're able to somehow retrieve a screen_window_t, then you can directly query it's group and join your new window to that group.
screen_get_property_cv((screen_window_t)window->winId(), SCREEN_PROPERTY_GROUP, &dest);
But yes, that's terribly prone to breaking if there is ever an implementation change, as mcquire points out.
Definitely follow whatever the recommented QPlatformNativeInterface route is.
Cheers,
Sean
10-05-2012 11:33 AM
I'm so excited by these answers!
But im so sorry that i need one final bit of help probably due to my lack of c++ knowledge.
base operand of '->' has non-pointer type 'std2::mywindow' is the error for
screen_get_window_property_cv((screen_window_t)win
and trying this way the other way
const char * const groupNameData = static_cast<const char *>(nativeInterface->nativeResourceForWidget("windo
gives an error
invalid use of incomplete type 'struct QPlatformNativeInterface
I just want to report back success!
10-05-2012 11:39 AM
(screen_window_t)(window->winId()) is probably what I meant to say.
as for the other, sounds like you're missing an include which defines class QPlatformNativeInterface{ ... };
10-05-2012 12:55 PM
Even though im pretty sure both of you have provided me with the answer to my long struggle figuring out how to link the 2 screens - i still cant implement neither of the approaches.
I have just tried with various approaches ranging from showing screen before doing nativeResourceForWidget and after this call. Neither work - I end up with debugger highlighting the line nativeResourceForWidget.
I notice nativeResourceForWidget needs a top level widget, I tried changing mywindow to a QWidget instead of QMainWindow but moc starting throwing errors so reverted back in case I could just pass window.topLevelWidget as initially hoped.
I'll post the start of the main function in case it help s someone help me with what i hope is a simple issue now compared to the rest of the problems the community has helped me solve.
QCoreApplication::addLibraryPath("app/native/lib") ;
QApplication app(argc, argv);
mywindow window;
window.resize(500, 500);
QPalette pal = window.palette();
pal.setColor(QPalette::Window, Qt::red);
window.setPalette(pal);
window.setMaximumHeight(300);
QPlatformNativeInterface * const nativeInterface = QApplication::platformNativeInterface();
const char * const groupNameData = static_cast<const char *>(
nativeInterface->nativeResourceForWidget("windowGr oup", window.topLevelWidget()));
//const QString groupName = QString::fromLatin1(groupNameData);
window.show();
10-05-2012 01:02 PM - edited 10-05-2012 01:07 PM
I also tried with your approach Sean but I just couldnt get past the compiler, I did already do what you suggested before you posted again but I think you might have missed it. The error is
Multiple markers at this line
- at this point in file
- invalid conversion from '_screen_window**'
to 'int'
I didnt understand &dest - was that an int?
//screen_win is a native screen
screen_get_window_property_cv((screen_window_t)win
and trying with ->windId results in compiler error #
base operand of '->' has non-pointer type 'std2::mywindow'
10-05-2012 02:27 PM
native window over qt window - yes!
char test[200];
screen_get_window_property_cv((screen_window_t)win
I still cant do it the proper way though because of it just closing so if anyone can tell me why after looking at my attempt using nativeResourceForWidget then that will be great.
Next, videos frames over qt screen!
10-06-2012 06:55 PM
I have now been searching around all day for a way to show some buttons using qt over the video which is being displayed in the native window, this native window is over the top of a qtmainwindow.
Any suggestions?
10-06-2012 07:06 PM
Do you still have the z index at like 10? Try lowering that to 0 or -1.
10-06-2012 07:16 PM
good suggestion mreed.
I set it to -1 in a swipe down event and the video dissapears. I'm assuming it's now just a matter of adding the buttons on to the behind screen and setting its transparency so the video is shown below the buttons. Hope its that straight forward!
Cant thank you enough for your help.
C
10-11-2012 09:07 AM
mcguire,
the only thing we can get usin nativeResourceForWidget is native window group, how do we get native screen context Qt is using?