PDA

View Full Version : Is there a clock component?



arcull
3rd July 2015, 07:11
Hi everyone. I wonder if there is some clock or digital clock component available that I could use in my gui desktop app. I need just to display time in a more pretty way, thats all. I've checked the compenents in my Qt Creator, but don't see any. Thanks for suggestions.

anda_skoa
3rd July 2015, 08:20
You could combine a couple of QLCDNumber objects into a custom component.

Cheers,
_

ChrisW67
3rd July 2015, 09:46
No bundled ready-to-go clocks.

A simple clock along the lines anda_skoa suggested:
Digital Clock Example (http://doc.qt.io/qt-5/qtwidgets-widgets-digitalclock-example.html)
An analogue clock you could adapt to render however you like:
Analogue Clock Example (http://doc.qt.io/qt-5/qtwidgets-widgets-analogclock-example.html)

Uwe
3rd July 2015, 12:22
Qwt has a widget ( QwtAnalogClock ) but no QML component. But when writing a desktop application I would consider widgets still being the better option than going with QML.

Uwe

anda_skoa
3rd July 2015, 13:36
Qwt has a widget ( QwtAnalogClock ) but no QML component. But when writing a desktop application I would consider widgets still being the better option than going with QML.

You mean QtQuick, but yes :)

Cheers,
_

wysota
3rd July 2015, 14:28
You mean QtQuick, but yes :)

He probably means both :)

arcull
4th July 2015, 12:01
Thanks, but where do I get this QwtAnalogClock, I don't see it under "Display Widgets"?

Added after 7 minutes:


Thanks, but where do I get this QwtAnalogClock, I don't see it under "Display Widgets"?Aha I see, I need this Qwt library. Will try how, thanks.

ars
4th July 2015, 12:30
You need to install qwt on your machine. For Linux chances are good you can install precompiled binaries (developer packages) from your repositories. For Windows, download it from http://qwt.sourceforge.net/ and compile it yourself.

Regards
ars

dongeng
4th July 2015, 16:47
No bundled ready-to-go clocks.
http://mazpics.science/54/g.png
A simple clock along the lines anda_skoa suggested:
Digital Clock Example (http://doc.qt.io/qt-5/qtwidgets-widgets-digitalclock-example.html)
An analogue clock you could adapt to render however you like:
Analogue Clock Example (http://doc.qt.io/qt-5/qtwidgets-widgets-analogclock-example.html)

Thanks for link advice

arcull
7th July 2015, 18:06
Uff, can you help me to install this Qwt correctly, I'll open another thread if necessary... Yes, I've read the documentation and also have found similar posts on this forum, but got stuck. What I did so far:

Download the source of qwt qwt-6.1.2.zip for windows, extract it to some folder
open comand propmpt of Qt MinGw
run qmake qwt.pro targeting the qwt.pro in my folder
mingw32-make
mingw32-make install
now I have binaries in folder C:\Qwt-6.1.2
Add new environmental variable QT_PLUGIN_PATH and add C:\Qwt-6.1.2\plugins to it
open qt creator, go to Tools->Form Editor->About Qt designer plugins and see it under failed plugins

The error is:Cannot load library C:/Qwt-6.1.2/plugins/designer/qwt_designer_plugin.dll: The specified procedure could not be found. But I see the file exists on disk. Any suggestion how could I make this work. I'd like to use Qwt inside Qt creator if possible. Much thanks

Added after 8 minutes:

I haven't compiled Qt crator my self, just installed binary for windows. If I check help->about qt crator, I see: Based on Qt 5.3.1 (MSVC 2010, 32 bit), but I compiled qwt with mingw, is that a problem?

wysota
7th July 2015, 19:55
I haven't compiled Qt crator my self, just installed binary for windows. If I check help->about qt crator, I see: Based on Qt 5.3.1 (MSVC 2010, 32 bit), but I compiled qwt with mingw, is that a problem?

Yes, you need to use the same compiler family as Creator was built with.

ChrisW67
7th July 2015, 21:25
The visual plugin for Qt Designer/Qt Creator must be built with the same compiler as the Qt Creator was. However, the plugin is not entriely necessary to use the Qwt library. You can use your MingW-built library with your MingW-built application by either coding the Ui manually, or by placing a QWidget in Qt Creator and using the Promote feature to tell Qt to generate code for QwtWhatever where it sees that widget. It is not WYSIWYG but it does work.

arcull
8th July 2015, 17:38
Thanks ChrisW67, I prefer visual designer, it makes a lot of things easier for a beginner..especially now when I don't even know what components does Qwt have to offer and how do they behave... Since I have a MSVC build of Qt Creator I tried to compile Qwt with namke, but I got a bunch of bla bla errors and I think I wont get through that easily...So I thought I would rather get a mingw version of Qt creator for windows if available, compiling one probably isn't easy.