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] The Qt classwizard example can't display image under windows7

[Solved] The Qt classwizard example can't display image under windows7

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 4.8k 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.
  • C Offline
    C Offline
    CrazyWind
    wrote on last edited by
    #1

    It seems that
    @
    setPixmap(QWizard::WatermarkPixmap, QPixmap(":/images/watermark1.png"));
    @

    doesn't work properly under win7, I compile and run this example under xp, it works as expected and displays the image, when I copy the classwizard.exe back to win7, it can't still display the image. I add the following code:

    @
    QLabel *label2 = new QLabel;
    label2->setPixmap(QPixmap(":/images/background.png"));
    label2->show();
    @

    lable2 can display the image properly. So what's wrong with it? Thanks in advance.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Hi,

      first of all, please use the @-tags for code highlighting.
      did you try to diosplay the watermark1.png in the label? just to ensure, this image works?

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CrazyWind
        wrote on last edited by
        #3

        Sorry, that was my first post and I didn't konw that.
        Yes, the code
        @
        QLabel *label2 = new QLabel;
        label2->setPixmap(QPixmap(":/images/watermark1.png"));
        label2->show();
        @
        can display the image waermark1.png properly under win7 in label2.
        None of the pictures of this example can display in any pages of classwizard example under win7, when I copy the classwizard.exe from win7 to xp, the program works fine and all the pictures can display properly. I'm wondering what prevents the pictures from displaying in win7.
        Anyone else has tested it?
        Thank you.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          Do you have the same environment in win7 (dll, qt plugins, etc.) there on win7 as on win XP?

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • C Offline
            C Offline
            CrazyWind
            wrote on last edited by
            #5

            [quote author="Gerolf" date="1304750586"]Do you have the same environment in win7 (dll, qt plugins, etc.) there on win7 as on win XP?[/quote]

            I built this example statically so it's a stand-alone executable and doesn't rely on libgcc_s_dw2-1.dll, mingwm10.dll,QtCore4.dll,QtGui4.dll .
            Besides, the picture's format is png, so it doesn't need any plugin, right?
            Despite of whether the example is built in win7 or xp, the result is the same. I run it on other's pc(win7), the picture won't appear, but in xp, everything is right. Is this a bug?
            Or, something wrong with my system?

            1 Reply Last reply
            0
            • G Offline
              G Offline
              giesbert
              wrote on last edited by
              #6

              Hi CrazyWind,

              I just tried out the example and had a look at the docs. The wizard behaves exaclty as described :-)
              If you set the style to Classic, it shows the pixmaps:

              @
              setWizardStyle(QWizard::ClassicStyle);
              @

              have a look at the "docs of QWizard":http://doc.qt.nokia.com/4.7/qwizard.html#wizard-look-and-feel

              On Win7, it hase Aero style by default, as all other things on winb7 get the win7 style :-)

              bq. wizardStyle
              This property holds the look and feel of the wizard.
              By default, QWizard uses the AeroStyle on a Windows Vista system with alpha compositing enabled, regardless of the current widget style. If this is not the case, the default wizard style depends on the current widget style as follows: MacStyle is the default if the current widget style is QMacStyle, ModernStyle is the default if the current widget style is QWindowsStyle, and ClassicStyle is the default in all other cases.

              Nokia Certified Qt Specialist.
              Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

              1 Reply Last reply
              0
              • C Offline
                C Offline
                CrazyWind
                wrote on last edited by
                #7

                [quote author="Gerolf" date="1304756083"]Hi CrazyWind,

                I just tried out the example and had a look at the docs. The wizard behaves exaclty as described :-)
                If you set the style to Classic, it shows the pixmaps:

                @
                setWizardStyle(QWizard::ClassicStyle);
                @

                have a look at the "docs of QWizard":http://doc.qt.nokia.com/4.7/qwizard.html#wizard-look-and-feel

                On Win7, it hase Aero style by default, as all other things on winb7 get the win7 style :-)

                [/quote]

                Yeah, you got the point! It works now. _^^ Thank you!
                PS: I prefer to use @setWizardStyle(QWizard::ModernStyle);@ instead of @setWizardStyle(QWizard::ClassicStyle);@
                otherwise the code @setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png"));@ may still fail. _^
                ^

                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