PDA

View Full Version : Some questions about Qt and App creation...



V I R U S
1st September 2010, 10:27
Hello everyone!

I'm starting with Qt, so I'm pretty new in it. Mainly I'm PHP/C#/VB.NET developer and there are some differences.

There are some things i can't understand. I've used search, readed a lot of threads here, but anyway, i don't get it.


1. We trying to create some app, it should have it's own updater function. As you start the main app, it will connect to server and check if there are some updates. MainWindow is hidden on start.
a. if there is no update, the MainWindow will appear.
b. if new update was found, MainWindow will stay hidden, but there should appear new window with progress bar which will show progress status.
Question: As what should i define this new Window in part B? As new QWidget and create Progress Bar in it or there is another way?

2. I have read a lot of threads here, found a classes to customize the skin of own application. This thread is from year 2007, and somehow a little bit old. We want to customize our app as far as possible, like own frame skin for MainWindow, all sub-windows, controls and other. Is there some good Topics or Manuals describing how to do that?

Sorry if i missed somewhat and it was already discussed here.
Thanks!

marcvanriet
1st September 2010, 12:52
Hello V i r u s (bad name by the way),

For an app to update itself is always tricky. When an .exe is running, it can't just be replaced.

I would suggest first starting an 'updater' executable instead of the real application. This would be a QDialog based application (not using a QMainWindow). In the main() of this application, you could check if an update is required, and if not, just don't show the dialog. At the end of this updater, you can execute your real application sing QProcess::execute() or so.

For the skins, I have no experience with that.

Do you use QtCreator ? If not, I would really advice you to do so. It really helps in getting you started with Qt.

Best regards,
Marc

V I R U S
1st September 2010, 20:25
Yeah, some ppl are somehow scared when they see my nickname, but i have it over 6 years and don't wanna change it =))

I know that it's tricky to replace and existing and used file, the main idea was to create a temporary file, start the replacing routine hidden and then to start the app normally. That should work well, i think =))

Of cource i'm using the Qt Creator, there are some options i've found very helpfull, but anyway i can't get the main frame (see as Windows Frame) changed. Customisation of buttons isn't that hard, just with right click and then edit.

V I R U S
3rd September 2010, 08:27
So, may be someone know good manual or thread where all this parts are described well, how to customize skin of an app?

squidge
3rd September 2010, 08:59
Typically how programs update themselves is kinda how marcvanriet explained it - the main app runs, checks for updates, and if it finds one it runs the updater app and quits, the updater app then downloads, extracts, overwrites the exe and then runs that new exe and quits.

As for skinning, have a look at the 'themes' or 'tux' example, depending on what you need to do.

V I R U S
3rd September 2010, 15:39
As for skinning, have a look at the 'themes' or 'tux' example, depending on what you need to do.
QT Example or here in "search"? =)

tbscope
3rd September 2010, 16:07
Some examples of skinning:
http://doc.qt.nokia.com/4.6/widgets-styles.html
http://doc.qt.nokia.com/4.6/widgets-stylesheet.html

I haven't tried the new Qt Quick, but I think (and I want to stress the "think" part) you can go even beyond simple skinning.