跳到內容
  • 版面
  • 最新
  • 標籤
  • 熱門
  • 使用者
  • 群組
  • 搜尋
  • Get Qt Extensions
  • Unsolved
Collapse
品牌標誌
  1. 首頁
  2. Qt Development
  3. General and Desktop
  4. Access and inheritance
Forum Updated to NodeBB v4.3 + New Features

Access and inheritance

已排程 已置頂 已鎖定 已移動 Solved General and Desktop
49 貼文 5 Posters 11.8k 瀏覽 4 Watching
  • 從舊到新
  • 從新到舊
  • 最多點贊
回覆
  • 在新貼文中回覆
登入後回覆
此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
  • mrjjM mrjj

    @tomy
    Hi
    Nope its just how the QWidgets look.
    If you change the icons to flat style,
    it will look more "modern"

    You could use something like
    https://github.com/laserpants/qt-material-widgets
    if you want to go all in for "modern" look.

    tomyT 離線
    tomyT 離線
    tomy
    寫於 最後由 編輯
    #31

    @mrjj

    If you change the icons to flat style, it will look more "modern"

    Hi,
    The example you posted look very modern and stylish, but too advanced for me now. Thank you.
    I like to go step by step. So for the icons, I must download some "flat .png related files" from the Internet and substitute the old ones with these. Right?

    mrjjM 1 條回覆 最後回覆
    0
    • tomyT tomy

      @mrjj

      If you change the icons to flat style, it will look more "modern"

      Hi,
      The example you posted look very modern and stylish, but too advanced for me now. Thank you.
      I like to go step by step. So for the icons, I must download some "flat .png related files" from the Internet and substitute the old ones with these. Right?

      mrjjM 離線
      mrjjM 離線
      mrjj
      Lifetime Qt Champion
      寫於 最後由 編輯
      #32

      @tomy
      Hi
      Yes, that could be the first step.
      Maybe a bit of stylesheet to make QToolbar more flat to fit the new icons.
      I dont have an image of spreadsheet app around so im not sure what else you can
      do currently. will write of get any other ideas.

      1 條回覆 最後回覆
      1
      • kshegunovK kshegunov

        What @mrjj said, plus the moment you define a constructor, the compiler stops generating for you. Thus if you define a constructor with parameters, the compiler will not generate a default constructor for you. Beautiful system, right? :)

        tomyT 離線
        tomyT 離線
        tomy
        寫於 最後由 編輯
        #33

        @kshegunov

        Beautiful system, right? :)

        Right. :)

        @mrjj

        Yes, that could be the first step.
        Maybe a bit of stylesheet to make QToolbar more flat to fit the new icons.
        I dont have an image of spreadsheet app around so im not sure what else you can
        do currently. will write of get any other ideas.

        Hi, Thanks. So I need to lookup "stylesheet".

        mrjjM 1 條回覆 最後回覆
        0
        • tomyT tomy

          @kshegunov

          Beautiful system, right? :)

          Right. :)

          @mrjj

          Yes, that could be the first step.
          Maybe a bit of stylesheet to make QToolbar more flat to fit the new icons.
          I dont have an image of spreadsheet app around so im not sure what else you can
          do currently. will write of get any other ideas.

          Hi, Thanks. So I need to lookup "stylesheet".

          mrjjM 離線
          mrjjM 離線
          mrjj
          Lifetime Qt Champion
          寫於 最後由 編輯
          #34

          @tomy

          Hi
          https://doc.qt.io/qt-5/stylesheet.html

          tomyT 2 條回覆 最後回覆
          1
          • mrjjM mrjj

            @tomy

            Hi
            https://doc.qt.io/qt-5/stylesheet.html

            tomyT 離線
            tomyT 離線
            tomy
            寫於 最後由 編輯
            #35

            @mrjj
            Thanks to you. :)

            1 條回覆 最後回覆
            0
            • mrjjM mrjj

              @tomy

              Hi
              https://doc.qt.io/qt-5/stylesheet.html

              tomyT 離線
              tomyT 離線
              tomy
              寫於 最後由 編輯
              #36

              @mrjj Hi,

              I created a new project called MySpreadsheet and added a few more options to the context menu and renewed the icons to flat ones.
              Now when I run the project, it runs normally, but when we close it, the follwoing message is written in the Application Output window:

              Starting D:\Projects\Qt\MySpreadsheet\MySpreadsheet\build-MySpreadsheet-Desktop_Qt_5_12_0_MinGW_64_bit-Debug\debug\MySpreadsheet.exe...
              FTH: (243752): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. ***
              The program has unexpectedly finished.
              The process was ended forcefully.
              D:/Projects/Qt/MySpreadsheet/MySpreadsheet/build-MySpreadsheet-Desktop_Qt_5_12_0_MinGW_64_bit-Debug/debug/MySpreadsheet.exe crashed.

              What is the problem please?
              Is it not related to the .pro file, please?

              jsulmJ 1 條回覆 最後回覆
              0
              • tomyT tomy

                @mrjj Hi,

                I created a new project called MySpreadsheet and added a few more options to the context menu and renewed the icons to flat ones.
                Now when I run the project, it runs normally, but when we close it, the follwoing message is written in the Application Output window:

                Starting D:\Projects\Qt\MySpreadsheet\MySpreadsheet\build-MySpreadsheet-Desktop_Qt_5_12_0_MinGW_64_bit-Debug\debug\MySpreadsheet.exe...
                FTH: (243752): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. ***
                The program has unexpectedly finished.
                The process was ended forcefully.
                D:/Projects/Qt/MySpreadsheet/MySpreadsheet/build-MySpreadsheet-Desktop_Qt_5_12_0_MinGW_64_bit-Debug/debug/MySpreadsheet.exe crashed.

                What is the problem please?
                Is it not related to the .pro file, please?

                jsulmJ 離線
                jsulmJ 離線
                jsulm
                Lifetime Qt Champion
                寫於 最後由 編輯
                #37

                @tomy Please run through debugger and post stack trace after it crashed...

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                tomyT 1 條回覆 最後回覆
                0
                • jsulmJ jsulm

                  @tomy Please run through debugger and post stack trace after it crashed...

                  tomyT 離線
                  tomyT 離線
                  tomy
                  寫於 最後由 編輯
                  #38

                  @jsulm
                  Do you mean by pressing F5, please?
                  If so, I did it, but how to post stack trace?

                  0_1550499661735_Capture_1.PNG

                  1 條回覆 最後回覆
                  0
                  • mrjjM 離線
                    mrjjM 離線
                    mrjj
                    Lifetime Qt Champion
                    寫於 最後由 編輯
                    #39

                    Hi
                    It is the list to the right we are after

                    The code
                    for entries Level 2,3 would help a lot.

                    tomyT 1 條回覆 最後回覆
                    2
                    • mrjjM mrjj

                      Hi
                      It is the list to the right we are after

                      The code
                      for entries Level 2,3 would help a lot.

                      tomyT 離線
                      tomyT 離線
                      tomy
                      寫於 最後由 編輯
                      #40

                      @mrjj,
                      Hi,

                      0_1550500483783_1.PNG

                      Do you mean I copy and paste code for level 7 and 11 here?
                      7 is the project's code but 11 includes thousands of lines of code.

                      mrjjM 1 條回覆 最後回覆
                      0
                      • tomyT tomy

                        @mrjj,
                        Hi,

                        0_1550500483783_1.PNG

                        Do you mean I copy and paste code for level 7 and 11 here?
                        7 is the project's code but 11 includes thousands of lines of code.

                        mrjjM 離線
                        mrjjM 離線
                        mrjj
                        Lifetime Qt Champion
                        寫於 最後由 編輯
                        #41

                        @tomy
                        Hi
                        The line it shows when you click on 11 ? line 1339

                        tomyT 1 條回覆 最後回覆
                        1
                        • mrjjM mrjj

                          @tomy
                          Hi
                          The line it shows when you click on 11 ? line 1339

                          tomyT 離線
                          tomyT 離線
                          tomy
                          寫於 最後由 編輯
                          #42

                          @mrjj, Hi,

                          Here you are:

                          0_1550504186993_2.PNG

                          1 條回覆 最後回覆
                          0
                          • mrjjM 離線
                            mrjjM 離線
                            mrjj
                            Lifetime Qt Champion
                            寫於 最後由 編輯
                            #43

                            Hi
                            it was not what i as i had hoped, it being inside some of the user code.
                            I wonder if you have a double free.
                            Did you change anything in main.cpp?

                            tomyT 1 條回覆 最後回覆
                            0
                            • mrjjM mrjj

                              Hi
                              it was not what i as i had hoped, it being inside some of the user code.
                              I wonder if you have a double free.
                              Did you change anything in main.cpp?

                              tomyT 離線
                              tomyT 離線
                              tomy
                              寫於 最後由 tomy 編輯
                              #44

                              @mrjj Hi,

                              Here is main.cpp:

                              #include "myspreadsheet.h"
                              #include <QApplication>
                              #include <QSplashScreen>
                              
                              int main(int argc, char *argv[])
                              {
                                  QApplication app(argc, argv);
                              
                                  QSplashScreen* splash = new QSplashScreen;
                                  splash->setPixmap(QPixmap(":/images/splash.jpg"));
                                  splash->show();
                              
                                  Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;
                                  splash->showMessage(QObject::tr("Setting up the main window..."), topRight, Qt::white);
                              
                              
                                  MySpreadsheet* mySP = new MySpreadsheet;
                                  if(argc > 1)
                                      mySP -> loadFile(argv[1]);
                              
                                  mySP -> show();
                                  splash -> finish(mySP);
                                  delete splash;
                              
                                  return app.exec();
                              }
                              

                              I added those splash stuff and now apparently it's fine!

                              1 條回覆 最後回覆
                              0
                              • mrjjM 離線
                                mrjjM 離線
                                mrjj
                                Lifetime Qt Champion
                                寫於 最後由 編輯
                                #45

                                Hi
                                Does look fine.
                                Try set breakpoint in main.cpp and press f10 to signle step over it and
                                see if we can find the reason for the crash.
                                Since its first on close, it might be inside MySpreadsheet indirectly.

                                tomyT 1 條回覆 最後回覆
                                1
                                • mrjjM mrjj

                                  Hi
                                  Does look fine.
                                  Try set breakpoint in main.cpp and press f10 to signle step over it and
                                  see if we can find the reason for the crash.
                                  Since its first on close, it might be inside MySpreadsheet indirectly.

                                  tomyT 離線
                                  tomyT 離線
                                  tomy
                                  寫於 最後由 編輯
                                  #46

                                  @mrjj
                                  Hi, It's fine now. :) Thanks so much. :)

                                  mrjjM 1 條回覆 最後回覆
                                  1
                                  • tomyT tomy

                                    @mrjj
                                    Hi, It's fine now. :) Thanks so much. :)

                                    mrjjM 離線
                                    mrjjM 離線
                                    mrjj
                                    Lifetime Qt Champion
                                    寫於 最後由 編輯
                                    #47

                                    @tomy
                                    Hi
                                    What was it ? Just to learn also.

                                    tomyT 1 條回覆 最後回覆
                                    0
                                    • mrjjM mrjj

                                      @tomy
                                      Hi
                                      What was it ? Just to learn also.

                                      tomyT 離線
                                      tomyT 離線
                                      tomy
                                      寫於 最後由 編輯
                                      #48

                                      @mrjj Hi,

                                      The faulty one didn't include splash stuff and was this way I think:

                                      #include "myspreadsheet.h"
                                      #include <QApplication>
                                      
                                      int main(int argc, char *argv[])
                                      {
                                          QApplication app(argc, argv);
                                          MySpreadsheet* mySP = new MySpreadsheet;
                                          mySP -> show();
                                      
                                          return app.exec();
                                      }
                                      

                                      Then I added the splash stuff. Now it "apparently" is fine, but I'm still not sure not do I know of the exact reason for that red message either. :(

                                      1 條回覆 最後回覆
                                      1
                                      • SGaistS 離線
                                        SGaistS 離線
                                        SGaist
                                        Lifetime Qt Champion
                                        寫於 最後由 編輯
                                        #49

                                        You are not deleting mySP. The memory will be cleaned up at the end of the application but this doesn't mean that the destructor will be called. So if you have anything there that does something it's not guaranteed to be called.

                                        You should rather keep it on the stack or delete it after returning from app.exec();

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 條回覆 最後回覆
                                        3

                                        • 登入

                                        • Login or register to search.
                                        • 第一個貼文
                                          最後的貼文
                                        0
                                        • 版面
                                        • 最新
                                        • 標籤
                                        • 熱門
                                        • 使用者
                                        • 群組
                                        • 搜尋
                                        • Get Qt Extensions
                                        • Unsolved