Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Could not parse stylesheet of object 0x8046944

[SOLVED] Could not parse stylesheet of object 0x8046944

Scheduled Pinned Locked Moved General and Desktop
10 Posts 2 Posters 21.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rafael
    wrote on last edited by rafael
    #1

    how do i change the fonts of a qfiledialog? All the letters on my machine are really small.

    i added this in the constructor of my main window.

    'QFontDatabase fontDB;
    fontDB.addApplicationFont(":/qt/lib/fonts/DejaVuSans.ttf");'

    i call this function when i click a button to open a file dialog box.

    ' QFileDialog fd;
    fd.setStyleSheet("* {font-family: DejaVuSans;font-style: normal;font-size: 120pt;font-weight: bold;};");

    QString directory = fd.getExistingDirectory(this,
                                  tr("Find Files"), QDir::currentPath());
    
       if (!directory.isEmpty()) {
           if (ui->lineEdit->text() == "-1")
           {
    
           }
       }'
    

    i get a message saying Could not parse stylesheet of object 0x8046944

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by mcosta
      #2

      @rafael said:

      "* {font-family: DejaVuSans;font-style: normal;font-size: 120pt;font-weight: bold;};"

      Remove the last semicolon
      fd.setStyleSheet("* {font-family: DejaVuSans;font-style: normal;font-size: 120pt;font-weight: bold;}");

      BTW, of you need only to change the Font you can use QWidget::setFont()

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      1
      • R Offline
        R Offline
        rafael
        wrote on last edited by
        #3

        thanks that removed the message but it doesn't seem to apply the changes.

        this is what my file dialog looks like.

        http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.qt/discussion.general.topc26119/post113595?id=atch15713

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on last edited by
          #4

          Which platform??

          try to remove the style-sheet and pos a new image

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          R 1 Reply Last reply
          0
          • M mcosta

            Which platform??

            try to remove the style-sheet and pos a new image

            R Offline
            R Offline
            rafael
            wrote on last edited by rafael
            #5

            i am running qnx6.6.0 on virtual box
            i have a windows host

            that is my main window i managed to modify the text box and button

            http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.qt/discussion.general.topc26119/post113604?id=atch15719

            the button calls a filedialog box

            http://community.qnx.com/sf/sfmain/do/downloadAttachment/projects.qt/discussion.general.topc26119/post113604?id=atch15718

            i have tried with and without the stylesheet i get the same result.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mcosta
              wrote on last edited by
              #6

              Hi,

              sorry I have no experience on QNX.
              Could you please post your code? I don't think is relevant but try to remove the QFontDatabase part

              Once your problem is solved don't forget to:

              • Mark the thread as SOLVED using the Topic Tool menu
              • Vote up the answer(s) that helped you to solve the issue

              You can embed images using (http://imgur.com/) or (http://postimage.org/)

              1 Reply Last reply
              0
              • R Offline
                R Offline
                rafael
                wrote on last edited by
                #7

                thanks the problem has been resolved.
                style sheets have been applied correctly i just couldn't see it because i was using the wrong settings.
                I entered the screen resolution instead of physical dimensions when i was configuring my setup.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mcosta
                  wrote on last edited by
                  #8

                  @rafael said:

                  thanks the problem has been resolved.
                  style sheets have been applied correctly i just couldn't see it because i was using the wrong settings.
                  I entered the screen resolution instead of physical dimensions when i was configuring my setup.

                  Ok,

                  in that case I suggest to mark the post as SOLVED

                  Once your problem is solved don't forget to:

                  • Mark the thread as SOLVED using the Topic Tool menu
                  • Vote up the answer(s) that helped you to solve the issue

                  You can embed images using (http://imgur.com/) or (http://postimage.org/)

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    rafael
                    wrote on last edited by
                    #9

                    how do i do that?

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mcosta
                      wrote on last edited by mcosta
                      #10

                      You should have a tool box with that option

                      mmmm, seems available only for admins!!

                      So you could add a prefix [SOLVED] to the title

                      Once your problem is solved don't forget to:

                      • Mark the thread as SOLVED using the Topic Tool menu
                      • Vote up the answer(s) that helped you to solve the issue

                      You can embed images using (http://imgur.com/) or (http://postimage.org/)

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved