PDA

View Full Version : Weird Deployment Behavior, Windows



skepticalgeek
4th October 2010, 17:29
I have completed my jukebox app, and am trying to deploy it on a target Windows machine that does not have Qt installed. I have created a setup script using Inno, and I can install the app OK, but have some alien issues when running.

1) Most, but not all, of the controls on the Main window are in a vertical layout, which has some other nested alyouts, and other controls. In the Resize event for the Main Window, I have this line of code:
ui->verticalLayout_3->setGeometry(QRect(2,2,event->size().width(),event->size().height()));

so that the layout will resize to the new size of the form, and expand or shrink the controls within. But it doesn't do that. I developed the app on a netbook, and am trying to deploy on a full sized laptop. If the resolution is larger than what I developed at, the controls do not expand to fill the space, and if it is smaller, I dno't see all the controls. They are clipped by the side of the screen.

2) The part of the app requiring network functionality, the album art downloader, crashes the app without explanation. I have QNetwork4.dll installed. Do I need somethig else?

3) The music tracks do not actually play. They queue up fine, but nothing happens. I have phonon4, phonon_ds94, and QtMultimedia4 dlls installed. Again, am I mising something else, or some other step? In Linux, I have to configure the phonon backend in System Settings. Is there a similar Windows step I am missing? Tracks play just fine on development machine.

All dlls are installed in the same directory as the app. ANy help anyone can provide would be appreciated. Thanks.

Patrick aka skepticalgeek

squidge
4th October 2010, 20:59
First, I'd have to ask why not just use layouts properly instead of using constructs such as "ui->verticalLayout_3->setGeometry(QRect(2,2,event->size().width(),event->size().height()));" ? There's no need for this kind of code on a well designed ui.

Next, Phonon isn't a magic media player. It requires and depends on back ends to do some of its work (like the rendering of audio), and these back ends depend on what your trying to play. You may wish to check the codecs on the development machine compared to the machine your trying to get it to work on.

ChrisW67
4th October 2010, 22:25
1) It is probably only "working" on the smaller screen by accident rather than design. If you were using layouts as intended then this resizing logic would be unnecessary because resizing would Just Happen(tm).
2) Do I need somethig else? Yes, a debugger. Highly likely to be a dangling or null pointer. You may also need the Qt Web Kit library but we have no way of knowing that.

skepticalgeek
4th October 2010, 23:20
Hmm. Easier to show than to tell. Attached is a screenshot of the main form. The main layout is a vertical layout. The frame at the top of the screen with the round buttons is the first item in the layout. The stuff in the middle, with the album art, track titles, etc. is a single custom control called an album panel. This is the second item in the layout. All the stuff at the bottom is a horizontal layout with other nested layouts. This is the third item. What you do not see is two other album panels, prevPanel and nextPanel. What happens is that as you hit the left and right arrow keys, The previous and next panels slide in from the left/right, like sliding glass door. The rest of the time they are invisible. I can't put these in the layout, because they screw up the positioning of the other controls. So, I can't just make this layout the default layout of the form, because of the controls that aren't on it. That is is why I have that line of code there, to automatically resize the layout when the form resizes.

As for the phonon issues, a more expansive Google search pulled up a couple of possible solutions. According to the Official doc, I need to distribute the OpenGL library with phonon, wich I did not do. Also, supposedly I need to put the phonon_ds94 dll in a separate subfolder in the app called phonon_backend. I will try these solutions tonight hen I get home, and post whether they worked. Thanks for the advice.

ChrisW67
5th October 2010, 01:53
How do you intend that the album panels resize? Could you put the three album panels side-by side into a QScrollArea (hide the scroll bars) and programatically slide the contents left/right to expose the appropriate panel in the scroller viewport?

skepticalgeek
5th October 2010, 09:37
The album panel, and the controls within, resize properly. When I developed tha album panel, I created a test applet to make sure resizing of that control worked properly. I am going to go into the vertical layout, and make sure everything in there has the size policy set to Expanding. I'm thinking perhaps some control in the layout is set to Fixed or Minimum and that may be screwing up the resizing of the layout.

The biggest problem though, is the phonon issue. On the development machine, a netbook running XP, I just installed the Qt package from the Trolltech web site, and everything worked. On the deployment machine, a laptop running Win7, I install the Qt dlls, including phonon, OpenGl, and QtMultimedia, either in the app directory, or the system directory. No luck. I tried putting the phonon_ds94 dll in both plugins/phonon_backend, and phonon_backend, under the app directory. No luck. The phonon example music player doesn't work on the deployment machine either. It runs, but will not queue the files. This is not an obscure codec issue. These are mp3 files. Windows knows how to do mp3 out of the box. Obviously, simply copying over the appropriate dlls is not enough. I am missing some voodoo ritual necessary to make them actually work. Any ideas?

skepticalgeek
6th October 2010, 08:51
Ok. I have it partially solved. The resize problem I fixed by putting all the visible controls in a frame, using a layout on the frame, and then resizing the frame as part of the resize event. The music files are playing now. I distributed the OpenGL dll along with phonon, and put the phonon_ds94 dll in phonon_backend in the app directory. I also mad sure all the Qt dlls were the same version. I think I had some version conflicts. Curious thing. The dll files in Qt\2010.04\bin, all version 4.7.0, do not work. I get numerous entry point errors with them. The ones in qt\2010.04\qt\bin work. Anyone know why?

That still leaves the final problem. The parts of the app that access the internet, crash the app. I am using basic NetworkAccessManager and NetworkRequest/Reply objects. I have the Qt Network dll installed. Does this sound familiar to anyone?