Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QWSServer : Changing background color
Qt 6.12 LTS is out! See what's new in the release blog

QWSServer : Changing background color

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 3 Posters 9.7k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello,

    I'm using Qt4.8 on an embedded platform and I would like to change the background color of the QWSServer to set it as transparent.
    I tried to change the QWSServer's brush using the function qwsServer->setBackground(QBrush(Qt::transparent)); but it doesn't work.
    I also tried Qt::red, Qt::white but the background color remains unchanged.

    Does anyone have an idea ?

    Thanks.

    Here is my initialization code...
    @int main(int argc, char *argv[])
    {
    QApplication a(argc, argv, QApplication::GuiServer);
    qwsServer->setBackground(QBrush(Qt::transparent));

    CustomWindow w;
    w.setGeometry(50, 50, 500, 300);
    w.show();
    return a.exec();
    }
    @

    1 Reply Last reply
    0
    • B Offline
      B Offline
      blaroche
      wrote on last edited by
      #2

      try this

      @#include <QWSServer>
      int main(int argc, char *argv[])
      {
      QApplication app(argc, argv);

      #ifdef Q_WS_QWS
      app.setOverrideCursor( QCursor( Qt::BlankCursor ) );
      QWSServer::setCursorVisible( false );
      QWSServer::setBackground(QBrush(Qt::black));
      //QWSServer::setBackground(QBrush(Qt::transparent));  // have not tested  
      #endif
      

      }@

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Still doesn't work.

        Does it work on your side?

        Does your background change to black?

        1 Reply Last reply
        0
        • B Offline
          B Offline
          blaroche
          wrote on last edited by
          #4

          yes, setting it to white works as well

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            What Qt version do you use?

            PS : I use Direct FB display driver.

            1 Reply Last reply
            0
            • B Offline
              B Offline
              blaroche
              wrote on last edited by
              #6

              Sorry, I'm using 4.8. And not using Direct FB, using QWS_DISPLAY=LinuxFB.

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                I have same issue, and figured out it using /etc/directfbrc config. I added option bg-none or bg-color=000000 in config for transparent background. http://directfb.org/docs/directfbrc.5.html

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  Thanks all,

                  The solution of timon works.

                  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
                  • Unsolved