Results 1 to 13 of 13

Thread: Is there a clock component?

  1. #1
    Join Date
    Oct 2013
    Posts
    102
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Is there a clock component?

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is there a clock component?

    You could combine a couple of QLCDNumber objects into a custom component.

    Cheers,
    _

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Is there a clock component?

    No bundled ready-to-go clocks.

    A simple clock along the lines anda_skoa suggested:
    Digital Clock Example
    An analogue clock you could adapt to render however you like:
    Analogue Clock Example

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is there a clock component?

    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

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is there a clock component?

    Quote Originally Posted by Uwe View Post
    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,
    _

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is there a clock component?

    Quote Originally Posted by anda_skoa View Post
    You mean QtQuick, but yes
    He probably means both
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Oct 2013
    Posts
    102
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is there a clock component?

    Thanks, but where do I get this QwtAnalogClock, I don't see it under "Display Widgets"?


    Added after 7 minutes:


    Quote Originally Posted by arcull View Post
    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.
    Last edited by arcull; 4th July 2015 at 13:01.

  8. #8
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is there a clock component?

    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

  9. #9
    Join Date
    May 2015
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is there a clock component?

    Quote Originally Posted by ChrisW67 View Post
    No bundled ready-to-go clocks.

    A simple clock along the lines anda_skoa suggested:
    Digital Clock Example
    An analogue clock you could adapt to render however you like:
    Analogue Clock Example
    Thanks for link advice

  10. #10
    Join Date
    Oct 2013
    Posts
    102
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is there a clock component?

    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:
    1. Download the source of qwt qwt-6.1.2.zip for windows, extract it to some folder
    2. open comand propmpt of Qt MinGw
    3. run qmake qwt.pro targeting the qwt.pro in my folder
    4. mingw32-make
    5. mingw32-make install
    6. now I have binaries in folder C:\Qwt-6.1.2
    7. Add new environmental variable QT_PLUGIN_PATH and add C:\Qwt-6.1.2\plugins to it
    8. 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?
    Last edited by arcull; 7th July 2015 at 19:06.

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is there a clock component?

    Quote Originally Posted by arcull View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. #12
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Is there a clock component?

    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.

  13. #13
    Join Date
    Oct 2013
    Posts
    102
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is there a clock component?

    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.

Similar Threads

  1. Placing Clock on Title Bar
    By GG2013 in forum Newbie
    Replies: 2
    Last Post: 1st October 2013, 04:16
  2. How to change Linux system clock by Qt
    By wisconxing in forum Qt Programming
    Replies: 3
    Last Post: 7th September 2011, 08:04
  3. QObject and alarm clock
    By been_1990 in forum General Programming
    Replies: 2
    Last Post: 13th December 2009, 18:00
  4. QPainter and Qt analog clock example
    By Diph in forum Qt Programming
    Replies: 2
    Last Post: 25th September 2009, 18:34
  5. clock() function
    By mickey in forum General Programming
    Replies: 6
    Last Post: 12th September 2006, 15:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.