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. Changing format of a Cell (QXlsx lib)
QtWS25 Last Chance

Changing format of a Cell (QXlsx lib)

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 2 Posters 4.5k 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.
  • ZoptuneZ Offline
    ZoptuneZ Offline
    Zoptune
    wrote on last edited by
    #1

    Hi,

    I'm using the QXlsx lib to edit an excel file.
    The problem is that i can't find how to change the cell format (style and color)
    If someone has ever used this lib, help is welcome :)

    Thx

    note : QXlsx doc

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      I have never used it, but have you tried with
      http://qtxlsx.debao.me/document.html#setColumnFormat
      and the format class
      http://qtxlsx.debao.me/format.html

      1 Reply Last reply
      0
      • ZoptuneZ Offline
        ZoptuneZ Offline
        Zoptune
        wrote on last edited by
        #3

        I have already tried setColumnFormat() and setRowFormat() and they're working but i need to edit one cell not the whole row/column.
        I'll try the = operator, but the cell->format() method do not return a pointer so i think it will not work.

        Thx

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          Ok,
          Yes, there seems not to be cell->setFormat( myformat);
          I would snoop around in the code to get hints :)

          1 Reply Last reply
          0
          • ZoptuneZ Offline
            ZoptuneZ Offline
            Zoptune
            wrote on last edited by
            #5

            I don't understand why there is format method like setBorderStyle or setBorderColor but you can't get a cell's format.

            mrjjM 1 Reply Last reply
            0
            • ZoptuneZ Zoptune

              I don't understand why there is format method like setBorderStyle or setBorderColor but you can't get a cell's format.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Zoptune
              Well, since you can set format on whole col or row, i do think there be a
              setFormat to cell but maybe we just miss something very obvious. :)

              1 Reply Last reply
              0
              • ZoptuneZ Offline
                ZoptuneZ Offline
                Zoptune
                wrote on last edited by
                #7

                Yep, i found the obvious thing ^^
                The write(cell,value) method accepts a third parameter of type Format :)

                mrjjM 1 Reply Last reply
                2
                • ZoptuneZ Zoptune

                  Yep, i found the obvious thing ^^
                  The write(cell,value) method accepts a third parameter of type Format :)

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Zoptune
                  Yes, i saw that, but I though you wanted to edit existing
                  and write sounded like making new.
                  Good found :)

                  ZoptuneZ 1 Reply Last reply
                  0
                  • mrjjM mrjj

                    @Zoptune
                    Yes, i saw that, but I though you wanted to edit existing
                    and write sounded like making new.
                    Good found :)

                    ZoptuneZ Offline
                    ZoptuneZ Offline
                    Zoptune
                    wrote on last edited by
                    #9

                    @mrjj
                    If i just want to edit a cell i need to get the value/format and then use write function (not really efficient way ^^)

                    Thx for help

                    1 Reply Last reply
                    1

                    • Login

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