Can't watch preview



  • Hi,

    I'm quite new to Qt and got a bit of a problem. Preview in design mode only shows the layout of objects like the link below. On this screen I put a png file 64x64 resized to 0x0 for some reason appeared as a dot on a checkered rectangle. This rectangle doesn't mean to be a checkered, either.

    http://gyazo.com/e77280afa6618f4623d785bdb454a127

    I'm using Windows Vista and tried both VS2010 and MinGW. Both show the same problem. Can anybody help me, please?

    Thanks,



  • You could try to set a value to the width and hight in the designview. You see the gray bar above the designview where you have some inputboxes for Width and Height.

    Set them to 300 x 300 for instance, or as big as you want your item to be. That at least works for me.



  • Thanks Gennon, I tried your suggestion but only changed the size of checkered box.



  • Can you paste your qml code here?

    Have you set a width and height to your root item and a color to your background rectangle?



  • So this is the qml code, just a default given by project launcher, only color is changed to check if preview works.
    Actually this issue is not consistent. Sometimes preview works as it should be, with the very same qml code. It makes the matter worse, I guess.

    import QtQuick 2.0

    Rectangle {
    width: 360
    height: 360
    color: "#343434"
    Text {
    text: qsTr("Hello World")
    anchors.centerIn: parent
    }
    MouseArea {
    anchors.fill: parent
    onClicked: {
    Qt.quit();
    }
    }
    }



  • It could be a bug in QtCreator, which version are you running? I have 2.7.0 based on Qt. 5.0.2.



  • 2.7.0 based on Qt 5.0.2.
    Maybe I should report a bug. Meantime, I will try older or newer version of QtCreator.



  • Yea, but perhaps you should try a re-install (if you have not already). I had to uninstall and then delete the folder manually sometime to fix an installation.

    Anyway the 2.7.0 based on Qt 5.0.2 works on my machine a Lenovo X230 running Win 7 64-bit.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.