Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved Imbedding a bitmap for styles using , static const char * arrays

    General and Desktop
    2
    4
    97
    Loading More Posts
    • 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.
    • Trilec
      Trilec last edited by Trilec

      Hi All,
      Are there any tools or websites that can convert simple bitmaps to Qt friendly "static const char * const"
      Im creating my own style class and would like to in-code some of them.
      Im assuming the format is XPM?
      Also can other formats be imbeded (i would like to get alpha)

      static char* <variable_name>[] = {
      <Values>
      <Colors>
      <Pixels>
      <Extensions>
      };
      
      static const char * const qt_scrollbar_button_arrow_right[] = {
          "4 7 2 1",
          "   c None",
          "*  c #BFBFBF",
          "*   ",
          "**  ",
          "*** ",
          "****",
          "*** ",
          "**  ",
          "*   "};
      

      If ts not in the computer it doesn't exist!...

      1 Reply Last reply Reply Quote 0
      • Trilec
        Trilec last edited by

        Seem to have found one
        https://convertio.co/download/b53877295ae47929de85da0ee41c24df713200/

        If ts not in the computer it doesn't exist!...

        1 Reply Last reply Reply Quote 0
        • mrjj
          mrjj Lifetime Qt Champion last edited by mrjj

          Hi
          You can use a more modern way and use a QRessource file ?
          https://doc.qt.io/qt-5/resources.html

          PNGs are great for alpha.
          (can be imbedded too )

          Qt does not use XPM for style sheets or icons.

          1 Reply Last reply Reply Quote 0
          • Trilec
            Trilec last edited by

            @mrjj said in Imbedding a bitmap for styles using , static const char * arrays:

            Hi
            You can use a more modern way and use a QRessource file ?
            https://doc.qt.io/qt-5/resources.html

            Qt does not use XPM for style sheets or icons.

            Thanks Mrjj, will check it out,
            I'm referring to subclassing QProxyStyle etc. refer to qplastiquestyle.cpp, qfusionstyle,cpp
            XMP are imbedded in this and other styles.

            If ts not in the computer it doesn't exist!...

            1 Reply Last reply Reply Quote 0
            • First post
              Last post