How to set a GUI Theme to a Qt Widgets Application

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ต.ค. 2024

ความคิดเห็น • 59

  • @ideadomg
    @ideadomg 3 ปีที่แล้ว +14

    Clear, concise, to the point. Wish every tutorial was like this.

  • @HanKog-h2j
    @HanKog-h2j 6 หลายเดือนก่อน

    I tried your code to set the stylesheet, but it doesn't load it. That said, I noticed that my Qt 5.15.2 does not have a "QtTheme.h" header file. QtThemeSupport/qtthemesupportversion.h does not do the trick. Further, I saw that you are using "QtTheme window;" whereas my default app uses "MainWindow w;", which throws error "Unknown Type name".
    Did you run your code successfully on 5.15.2 or later?

  • @GemVic327
    @GemVic327 ปีที่แล้ว +1

    Pls am still woundering how you brought Qt into visual studio. Did you ceate folder with visual studio and then download the CSS file into it?

    • @VelcodeCS
      @VelcodeCS  ปีที่แล้ว

      I explain that here: th-cam.com/video/XiMplRfuFJc/w-d-xo.html

  • @abcxyz-nd6xh
    @abcxyz-nd6xh 3 ปีที่แล้ว +2

    Great & Practical Tutorial!
    Pure MS Theme is Boring!

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว

      Agree, but sometimes boring is okay 😁

  • @3arabiWalBanate
    @3arabiWalBanate 3 ปีที่แล้ว +1

    thanks for the video and website i need it

  • @sherafati
    @sherafati 3 ปีที่แล้ว +2

    Great video.
    I'm using Qt for Python and i'll try to implement it there. I believe it is possible.

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว

      If you have a chance and wouldn't mind reporting your findings 🙂

    • @moaminalabdullah175
      @moaminalabdullah175 2 ปีที่แล้ว

      app = QApplication(sys.argv)
      sshFile= 'Filename.qss'
      with open(sshFile, 'r') as f:
      app.setStyleSheet(f.read())

  • @leonardopinheiro6693
    @leonardopinheiro6693 2 ปีที่แล้ว +1

    Very good. Thank you.
    I noticed that, in one of the themes (Combinear.qss) the arrows are missing (QSpinBox::down-arrow). I had to make my own.

    • @VelcodeCS
      @VelcodeCS  2 ปีที่แล้ว +1

      Yes, many of these can use tweaks and additions for full UI coverage.

  • @stevehageman6785
    @stevehageman6785 หลายเดือนก่อน

    Nice! :-)

  • @markcuello5
    @markcuello5 ปีที่แล้ว

    HELP

  • @TheGhostfaceKLR
    @TheGhostfaceKLR 2 ปีที่แล้ว

    Who created that website?? The first text I saw read: "How It's Look Like" and "The graphic visual is something very important in a software". Not very confidence inspiring. LOL.

    • @VelcodeCS
      @VelcodeCS  2 ปีที่แล้ว

      I have no idea, but it's not a bad place to start. I personally got one from there and added/modified elements.
      But I agree, the one I used had a lot of little issues, but hey, it's free!

  • @idcrafter-cgi
    @idcrafter-cgi 2 ปีที่แล้ว

    on Linux you have native themes via kdestheme manager in it settings

  • @thuytienpham5428
    @thuytienpham5428 3 ปีที่แล้ว +1

    Hey Vel! I'm a bloody beginner of everything so I'm really glad I found you who actually make things understandable thank you so much for that! This might be the most stupid question but uhm ...how do I get on the very first screen you have? What or where is this ? Could you tell me how to get the exact same starting postition with like all the files like you have in this video so I can try and recreate evrything from there like you do? Maybe you have a video on that already? But I can't find it because i don't know what everything is called x'D

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว +2

      Hey Thuy! I know the pain! First off, you have to have Qt set up in your machine, which may be slightly different depending on the OS you are using. I have a video on how to set up Qt (version 6) using CMake (another C++ tool). Then, using CMake, I generate a project that can be run with Visual Studio (the IDE). I suggest you start first by setting up Qt in your machine the way I do. This is the link to the video:
      th-cam.com/video/XiMplRfuFJc/w-d-xo.html
      Once you have that setup, you'll know how we arrive to where this video beings (although I skip making the GUI, but it should be clear how that is done from the other video). If you want to know more on how to make the GUIs, you can view my other video:
      th-cam.com/video/h_DVfsD9PKI/w-d-xo.html
      I hope this helps!

    • @thuytienpham5428
      @thuytienpham5428 3 ปีที่แล้ว

      @@VelcodeCS woaaahh thank you so so much for replying and even took your time to explain it so thoroughly to me I really appreciate it! I will follow your instrcutions and will try not to loose my head xD Thank you again for helping me you are amazing!!

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว +1

      No problem and good luck!

  • @BharathRamMS
    @BharathRamMS ปีที่แล้ว

    Fantastic! Thanks for letting us know this information. Many thanks to you.

  • @karimklila9991
    @karimklila9991 2 ปีที่แล้ว

    QIODevice::read (QFile, ".\Obit.qss"): device not open

  • @joeking5211
    @joeking5211 ปีที่แล้ว

    Stunning vid. Many thks

  • @huanzhang5479
    @huanzhang5479 3 ปีที่แล้ว

    there are two or more qpushbuttons,if i want to set different theme for different qpushbutton, how to distinguish in qss file?

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว

      You can use the ID selector (#). See the documentation for an example:
      doc.qt.io/qt-5/stylesheet-syntax.html

  • @TheProGamerVibes
    @TheProGamerVibes 3 ปีที่แล้ว +1

    thanks i been searched for this long time i think i need to learn css now

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว +1

      I could use learning some more CSS for sure here too

  • @hamsham8244
    @hamsham8244 3 ปีที่แล้ว

    Hi
    I'm not getting these themes this is what I see in the application output could you please help.
    Could not parse application stylesheet
    qt.qpa.fonts: Unable to open default EUDC font: "C:\\Windows\\FONTS\\EUDC.TTE"

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว +1

      Hello! It seems that the theme you are using uses a particular font you do not have installed in your system. One thing to try (to verify this) is to try a completely different theme and see if that works. Based on that error, the thing that comes to mind is that the font you want to use is no where to be found.

    • @hamsham8244
      @hamsham8244 3 ปีที่แล้ว

      @@VelcodeCS Thank you, it worked

  • @jessprogany4345
    @jessprogany4345 3 ปีที่แล้ว

    thanks man, really helpful video
    cudos to the site

  • @digitalmachine0101
    @digitalmachine0101 2 หลายเดือนก่อน

    Good information

  • @lopo8000
    @lopo8000 2 ปีที่แล้ว

    Can u use a qt application for a game mod menu on a pc and also for a ps3?

    • @VelcodeCS
      @VelcodeCS  2 ปีที่แล้ว

      Umm, I have never seen anyone do it. I would say there are better more adequate tools for those tasks (like Unity or Unreal)

  • @beaconbecay1648
    @beaconbecay1648 3 ปีที่แล้ว

    Thanks for helping.

  • @lopo8000
    @lopo8000 2 ปีที่แล้ว

    How did u design the qttheme before adding the .css??

    • @VelcodeCS
      @VelcodeCS  2 ปีที่แล้ว

      Which theme? The white one?

  • @noah_bishop_z
    @noah_bishop_z ปีที่แล้ว

    Thanks 👍

  • @Pixel_Magic
    @Pixel_Magic 3 ปีที่แล้ว

    Hello, World! Hello from Russia! Thanks you for this video!

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว

      Hello to Russia!

  • @jacquesningana8283
    @jacquesningana8283 2 ปีที่แล้ว

    Thanks

  • @WahyuExano
    @WahyuExano 3 ปีที่แล้ว

    Thanks for your tutorial. Greeting from Indonesia!

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว

      No problem and hello to Indonesia!

  • @silversurfer8057
    @silversurfer8057 3 ปีที่แล้ว +2

    perfect .... no fancy useless stuff - just on point!

  • @lopo8000
    @lopo8000 2 ปีที่แล้ว

    does this also work with winforms?

    • @VelcodeCS
      @VelcodeCS  2 ปีที่แล้ว

      I don't have experience with winforms, but I doubt it since this is qss (q for Qt). Maybe there's a css style way of doing things with winforms, but I don't know about any, sorry!

  • @gregoryjoy2689
    @gregoryjoy2689 ปีที่แล้ว

    How do you make a light and dark mode

    • @VelcodeCS
      @VelcodeCS  ปีที่แล้ว +1

      You can create two separate themes and load the one you want depending on the mode that is selected.

  • @gatovsky
    @gatovsky 2 ปีที่แล้ว

    Excelente!!!

  • @adambukovsekdev
    @adambukovsekdev 3 ปีที่แล้ว

    Didnt work for me, as I continued I started to get more and more Errors in the whole code.

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว

      What kind of errors ate you getting?

    • @adambukovsekdev
      @adambukovsekdev 3 ปีที่แล้ว

      @@VelcodeCS It just says that I'm useing Variables that arent defined, and if I define them, it changes nothing. I talked to a friend about that, and he said that you were doing it completely wrong, and then it just worked with "setStyleSheet(stylesheet.qss)" instead of the whole code you were writeing.

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว +1

      Well, I don't know what you're doing, but you seem to have found your solution 👍

    • @seghirissam2662
      @seghirissam2662 3 ปีที่แล้ว

      @@VelcodeCS for me : pylance detect is a lot of errors in the qss file but when i run the code its work normally

    • @VelcodeCS
      @VelcodeCS  3 ปีที่แล้ว

      @@seghirissam2662 what is pylance?

  • @beyondhorizons9758
    @beyondhorizons9758 3 ปีที่แล้ว

    Awesome !

  • @amnesie148
    @amnesie148 4 ปีที่แล้ว

    goood!