跳到內容
  • 版面
  • 最新
  • 標籤
  • 熱門
  • 使用者
  • 群組
  • 搜尋
  • Get Qt Extensions
  • Unsolved
Collapse
品牌標誌
  1. 首頁
  2. International
  3. Chinese
  4. 欢迎大家来到Qt中文论坛
Forum Updated to NodeBB v4.3 + New Features

欢迎大家来到Qt中文论坛

已排程 已置頂 已鎖定 已移動 Chinese
86 貼文 65 Posters 164.2k 瀏覽 2 Watching
  • 從舊到新
  • 從新到舊
  • 最多點贊
回覆
  • 在新貼文中回覆
登入後回覆
此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
  • H 離線
    H 離線
    hitzjm
    寫於 最後由 編輯
    #38

    大家好,最近用pyside 编程,比较好用。但是前天 在程序里使用 Q_ARG 宏(用在C++程序里没有问题), pyside 不识别。有谁能帮助我吗。谢谢

    1 條回覆 最後回覆
    0
    • C 離線
      C 離線
      chenmin
      寫於 最後由 編輯
      #39

      我来拉
      [quote author="Xingtao Zhang" date="1312173268"]呵呵,有空就来转转。
      大牛们多发些技术贴啊。

      [quote author="Xingtao Zhang" date="1312000279"]那必须的! :)

      [quote author="Chuck Gao" date="1311946372"]
      [quote author="Xingtao Zhang" date="1311940164"]关注下,人气儿不怎么高啊![/quote]

      恩,目前才20个人,求给力!

      [/quote]

      [/quote]

      [/quote]

      1 條回覆 最後回覆
      0
      • C 離線
        C 離線
        cwang.nicolas
        寫於 最後由 編輯
        #40

        报道一下

        1 條回覆 最後回覆
        0
        • W 離線
          W 離線
          watchdog
          寫於 最後由 編輯
          #41

          在这里一起做什么?有项目吗?

          1 條回覆 最後回覆
          0
          • F 離線
            F 離線
            figo
            寫於 最後由 編輯
            #42

            报道

            1 條回覆 最後回覆
            0
            • J 離線
              J 離線
              jiangcaiyang
              寫於 最後由 編輯
              #43

              似乎不知道如何设置自己的头像……

              1 條回覆 最後回覆
              0
              • T 離線
                T 離線
                toby520
                寫於 最後由 編輯
                #44

                彩阳,哪里都有你的身影 哈哈,我也来啦,关注Qt,做Qter

                1 條回覆 最後回覆
                0
                • J 離線
                  J 離線
                  jiangcaiyang
                  寫於 最後由 編輯
                  #45

                  [quote author="toby520" date="1370487689"]彩阳,哪里都有你的身影 哈哈,我也来啦,关注Qt,做Qter[/quote]

                  是吗,为了官方论坛中文板块的兴旺,可以多在中文板块提问,我会尽我所能回答的。

                  1 條回覆 最後回覆
                  0
                  • R 離線
                    R 離線
                    realfan
                    寫於 最後由 編輯
                    #46

                    凑个热闹,怎么换头像啊

                    1 條回覆 最後回覆
                    0
                    • O 離線
                      O 離線
                      olunx
                      寫於 最後由 編輯
                      #47

                      新人报道,哦耶。

                      1 條回覆 最後回覆
                      0
                      • J 離線
                        J 離線
                        jayjie
                        寫於 最後由 編輯
                        #48

                        捧场,捧场来啦,弱弱的问一下,那个视频怎么看不起喃

                        1 條回覆 最後回覆
                        0
                        • J 離線
                          J 離線
                          jiangcaiyang
                          寫於 最後由 編輯
                          #49

                          YouTube的视频在大陆看不起。
                          [quote author="jayjie" date="1374976398"]捧场,捧场来啦,弱弱的问一下,那个视频怎么看不起喃[/quote]

                          1 條回覆 最後回覆
                          0
                          • E 離線
                            E 離線
                            eiao
                            寫於 最後由 編輯
                            #50

                            新人报道~从百度贴吧过来...

                            1 條回覆 最後回覆
                            0
                            • Z 離線
                              Z 離線
                              zixialang
                              寫於 最後由 編輯
                              #51

                              I'm coming.

                              1 條回覆 最後回覆
                              0
                              • L 離線
                                L 離線
                                liye0005
                                寫於 最後由 編輯
                                #52

                                新人报道

                                1 條回覆 最後回覆
                                0
                                • C 離線
                                  C 離線
                                  caochuanlong
                                  寫於 最後由 編輯
                                  #53

                                  我装的QT5.2,然后编译时提示没有compiler,请问该怎么弄呢?我时新手,呵呵

                                  1 條回覆 最後回覆
                                  0
                                  • J 離線
                                    J 離線
                                    jekin
                                    寫於 最後由 編輯
                                    #54

                                    一直不知有个中文的版块,一直用Qt遇到的问题是很多,因为英文表达比较差,所以很少提问,很多的问题都是靠自己反复阅读英文文档才搞明白,以后至少可以在这里向大家提提问。

                                    1 條回覆 最後回覆
                                    0
                                    • T 離線
                                      T 離線
                                      the_maskedman
                                      寫於 最後由 編輯
                                      #55

                                      新人来报个到.

                                      1 條回覆 最後回覆
                                      0
                                      • H 離線
                                        H 離線
                                        hou_jiangzhen
                                        寫於 最後由 編輯
                                        #56

                                        @
                                        #pragma once
                                        #ifndef HICONEDITOR_H
                                        #define HICONEDITOR_H
                                        #include <QWidget>
                                        //!@ HIConEditor 类描述
                                        //!@ 类名:HIConEditor
                                        //!@ 基类名:QWidget
                                        //!@ 文件名称:e:\DrawLine\test\HIConEditor.h
                                        //!@ 创建者:Administrator
                                        //!@ 创建时间: 2014/03/29 17:26:33
                                        //!@ 类描述:

                                        class HIConEditor:public QWidget
                                        {
                                        Q_OBJECT
                                        Q_PROPERTY(QImage iconImage READ GetIConImage WRITE SetIConImage)
                                        Q_PROPERTY(QColor penColor READ GetPenColor WRITE SetPenColor)
                                        Q_PROPERTY(int zoomFactor READ GetZoomFactor WRITE SetZoomFactor)
                                        public:
                                        HIConEditor(QWidget *pParent=0);

                                        void SetPenColor(const QColor &newColor);
                                        inline QColor GetPenColor()const{return m_curColor;}
                                        void SetIConImage(const QImage &newImage);
                                        inline QImage GetIConImage()const{return m_curImage;}
                                        void SetZoomFactor(const int nZoom);
                                        inline int GetZoomFactor()const{return m_nZoom;}

                                        //!@重写基类函数
                                        QSize sizeHint()const;

                                        //!@ 重写基类函数
                                        protected:
                                        void mousePressEvent(QMouseEvent * event);
                                        void mouseMoveEvent(QMouseEvent * event);
                                        void paintEvent(QPaintEvent * event);

                                        private:
                                        void SetImagePixel(const QPoint &ptPosition,bool bOpaque);
                                        QRect GetPixelRect( const int nX, const int nY);

                                        private:
                                        QColor m_curColor;
                                        QImage m_curImage;
                                        int m_nZoom;
                                        };

                                        #endif
                                        @
                                        @#include <QPainter>
                                        #include <QPaintEvent>
                                        #include "HIConEditor.h"
                                        HIConEditor::HIConEditor( QWidget pParent/=0*/ )
                                        :QWidget(pParent)
                                        {
                                        setAttribute(Qt::WA_StaticContents);
                                        setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
                                        m_curColor=Qt::black;
                                        m_nZoom=8;
                                        m_curImage=QImage(16,16,QImage::Format_ARGB32);//w,h
                                        m_curImage.fill(qRgba(0,0,0,0));
                                        }

                                        QSize HIConEditor::sizeHint() const
                                        {
                                        QSize qSize=m_nZoom*m_curImage.size();
                                        if (m_nZoom>=3)
                                        {
                                        qSize+=QSize(1,1);
                                        }
                                        return qSize;
                                        }

                                        void HIConEditor::SetPenColor( const QColor &newColor )
                                        {
                                        if (newColor != m_curColor)
                                        {
                                        m_curColor=newColor;
                                        }
                                        }

                                        void HIConEditor::SetIConImage( const QImage &newImage )
                                        {
                                        if (newImage !=m_curImage)
                                        {
                                        m_curImage=newImage.convertToFormat(QImage::Format_ARGB32);
                                        update();
                                        updateGeometry();
                                        }
                                        }

                                        void HIConEditor::SetZoomFactor( const int nZoom )
                                        {
                                        if (nZoom !=m_nZoom)
                                        {
                                        if (nZoom<1)
                                        {
                                        m_nZoom=nZoom;
                                        update();
                                        updateGeometry();
                                        }
                                        }
                                        }

                                        void HIConEditor::paintEvent( QPaintEvent * event )
                                        {
                                        QPainter painter(this);
                                        if (m_nZoom>=3)
                                        {
                                        painter.setPen(palette().foreground().color());
                                        for (int i=0;i<=m_curImage.width();i++)
                                        {
                                        painter.drawLine(m_nZoomi,0,m_nZoomi,m_nZoomm_curImage.height());
                                        }
                                        for(int i=0;i<=m_curImage.height();i++)
                                        {
                                        painter.drawLine(0,m_nZoom
                                        i,m_nZoomm_curImage.width(),m_nZoomi);
                                        }
                                        }
                                        for(int i=0;i<m_curImage.width();i++)
                                        {
                                        for(int j=0;j<m_curImage.height();j++)
                                        {
                                        QRect rect=GetPixelRect(i,j);
                                        if (!event->region().intersect(rect).isEmpty())
                                        {
                                        QColor color=QColor::fromRgba(m_curImage.pixel(i,j));
                                        if (color.alpha()<255)
                                        {
                                        painter.fillRect(rect,Qt::white);
                                        }
                                        else
                                        {
                                        painter.fillRect(rect,color);
                                        }
                                        }
                                        }
                                        }
                                        }

                                        QRect HIConEditor::GetPixelRect( const int nX, const int nY )
                                        {
                                        if (m_nZoom>=3)
                                        {
                                        return QRect(m_nZoomnX+1,m_nZoomnY+1,m_nZoom-1,m_nZoom-1);//(x,y,w,h)
                                        }
                                        else
                                        {
                                        return QRect(m_nZoomnX,m_nZoomnY,m_nZoom,m_nZoom);
                                        }
                                        }

                                        void HIConEditor::mousePressEvent( QMouseEvent * event )
                                        {
                                        if (event->button()==Qt::LeftButton)
                                        {
                                        SetImagePixel(event->pos(),true);
                                        }
                                        else if (event->button()==Qt::RightButton)
                                        {
                                        SetImagePixel(event->pos(),false);
                                        }
                                        }

                                        void HIConEditor::SetImagePixel( const QPoint &ptPosition,bool bOpaque )
                                        {
                                        int i=ptPosition.x()/m_nZoom;
                                        int j=ptPosition.y()/m_nZoom;
                                        if (m_curImage.rect().contains(i,j))
                                        {
                                        if (bOpaque)
                                        {
                                        m_curImage.setPixel(i,j,GetPenColor().rgba());
                                        }
                                        else
                                        {
                                        m_curImage.setPixel(i,j,qRgba(0,0,0,0));
                                        }
                                        update(GetPixelRect(i,j));
                                        }
                                        }

                                        void HIConEditor::mouseMoveEvent( QMouseEvent * event )
                                        {
                                        if (event->buttons()&Qt::LeftButton)
                                        {
                                        SetImagePixel(event->pos(),true);
                                        }
                                        else if (event->buttons()&Qt::RightButton)
                                        {
                                        SetImagePixel(event->pos(),false);
                                        }
                                        }
                                        @
                                        @#pragma once
                                        #ifndef HICONEDITORPLUGIN_H
                                        #define HICONEDITORPLUGIN_H
                                        #include <QDesignerCustomWidgetInterface>
                                        class HIconEditorPlugin :public QObject,public QDesignerCustomWidgetInterface
                                        {
                                        Q_OBJECT
                                        Q_INTERFACES(QDesignerCustomWidgetInterface) //告知qt这个类实现的是QDesignerCustomWidgetInterface接口
                                        public:
                                        HIconEditorPlugin(QObject*pParent=0);

                                        //!@ 重写
                                        QString name()const;
                                        //!@ 重写
                                        QString includeFile()const;
                                        //!@ 重写
                                        QString group()const;
                                        //!@ 重写
                                        QIcon icon()const;
                                        //!@ 重写
                                        QString toolTip()const;
                                        //!@ 重写
                                        QString whatsThis()const;
                                        //!@ 重写
                                        bool isContainer()const;
                                        //!@ 重写
                                        QWidget createWidget(QWidget parent);
                                        };
                                        #endif
                                        @
                                        @
                                        #include "HIconEditorPlugin.h"
                                        #include "HIConEditor.h"
                                        #include "qplugin.h"
                                        HIconEditorPlugin::HIconEditorPlugin( QObject
                                        pParent/
                                        =0*/ )
                                        :QObject(pParent)
                                        {

                                        }

                                        QString HIconEditorPlugin::name() const
                                        {
                                        return "HIConEditor";
                                        }

                                        QString HIconEditorPlugin::includeFile() const
                                        {
                                        return "HIConEditor.h";
                                        }

                                        QString HIconEditorPlugin::group() const
                                        {
                                        return tr("Image Manipulation Widgets");
                                        }

                                        QIcon HIconEditorPlugin::icon() const
                                        {
                                        return QIcon(":/images/iconeditor.png");
                                        }

                                        QString HIconEditorPlugin::toolTip() const
                                        {
                                        return tr("An icon editor widget");
                                        }

                                        QString HIconEditorPlugin::whatsThis() const
                                        {
                                        return tr("This widget is presented in Chapter 5 of <i>C++ GUI"
                                        "Programming with Qt 4</i> as example of a custom Qt"
                                        "widget.");
                                        }

                                        bool HIconEditorPlugin::isContainer() const
                                        {
                                        return false;
                                        }

                                        QWidget * HIconEditorPlugin::createWidget( QWidget *parent )
                                        {
                                        return new HIConEditor(parent);
                                        }
                                        Q_EXPORT_PLUGIN2(hiconeditorplugin,HIconEditorPlugin)@

                                        为什么下面这个QImage属性在QDesigner设计器中不显示,而其他定义的属性正常显示。
                                        !C:\Users\Administrator\Desktop\QQ图片20140330192657.jpg(F:\QQ图片20140330192657.jpg)!Q_PROPERTY(QImage iconImage READ GetIConImage WRITE SetIConImage)

                                        1 條回覆 最後回覆
                                        0
                                        • Q 離線
                                          Q 離線
                                          qq897425998
                                          寫於 最後由 編輯
                                          #57

                                          今天才发现 官网资源 这么丰富 以后就用官的论坛了

                                          1 條回覆 最後回覆
                                          0

                                          • 登入

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