摘要:
//xxx.h#ifdef CFG_API_BEING_COMPILED#ifdef WIN32#define CFG_API_EXPORT __declspec(dllexport)#else#define CFG_API_EXPORT#endif#else#if defined(WIN32) #... 阅读全文
posted @ 2013-03-31 15:37
奥雷连诺
阅读(291)
评论(0)
推荐(0)
摘要:
int wide = m_pFieldTable->columnWidth(0);int nRow = m_pFieldTable->rowCount();for(int i =0; isetColumnWidth(0, wide); m_pFie... 阅读全文
posted @ 2013-03-31 15:34
奥雷连诺
阅读(1037)
评论(0)
推荐(0)
摘要:
void test2::InitListWideget(){ m_pList = new rootDataList(this); m_pList->setGeometry(LIST_X, LIST_Y, LIST_W, LIST_H);QString str; for(int i = 0; ... 阅读全文
posted @ 2013-03-31 15:33
奥雷连诺
阅读(4971)
评论(0)
推荐(0)
摘要:
添加菜单方法1 m_pMenuBar= new QMenuBar(this); QMenu*pFileMenu = new QMenu("&文件",m_pMenuBar); QMenu*pOpenMenu = new QMenu("打开", pFileMenu); QMenu*pCreateMenu... 阅读全文
posted @ 2013-03-31 15:31
奥雷连诺
阅读(1656)
评论(0)
推荐(0)
摘要:
QAction ( const QString & text, QObject * parent )QAction ( const QIcon & icon, const QString & text, QObject * parent )QAction的两个构造函数中的text参数,文档的描述是:... 阅读全文
posted @ 2013-03-31 15:30
奥雷连诺
阅读(634)
评论(0)
推荐(0)
摘要:
void NodeConfigDlg::initNodeTable(){ m_pNodeTable = new QTableWidget(this); QStringList headerString; m_pNodeTable->setColumnCount(6); m... 阅读全文
posted @ 2013-03-31 15:28
奥雷连诺
阅读(578)
评论(0)
推荐(0)
摘要:
void xxxClass::xxxFun(){ m_StartMenu->addAction(act); m_StartMenu->addSeparator(); //如果没有这句,得到的sumHeight是菜单项的值;有了这句得到就是菜单总的高度 //,... 阅读全文
posted @ 2013-03-31 15:27
奥雷连诺
阅读(775)
评论(0)
推荐(0)
摘要:
Alright,Ifoundthereason.QWidget::create()clearstheQt::WA_QuitOnCloseattributeforanythingbutQt::Window,Qt::WidgetorQt::Dialog.Theworkaroundistocallfore... 阅读全文
posted @ 2013-03-31 15:26
奥雷连诺
阅读(1471)
评论(0)
推荐(0)
摘要:
#includeclassOpenProThread:publicQThread{Q_OBJECTpublic:OpenProThread(QObject*parent=0){}~OpenProThread(){}protected:virtualvoidrun(){//……//你的操作//……}p... 阅读全文
posted @ 2013-03-31 15:25
奥雷连诺
阅读(191)
评论(0)
推荐(0)
摘要:
比如,从文件中读出来的乱码,用QStringQString::fromLocal8Bit(constchar*str,intsize=-1)保证显示正确。比如,写入文件的时候乱码,用QByteArrayQString::toLocal8Bit()const保证写入不会乱码。 阅读全文
posted @ 2013-03-31 15:24
奥雷连诺
阅读(146)
评论(0)
推荐(0)
摘要:
我在QMainWindow上加了两个工具条,当在工具条上点击右键时会出现菜单,点击菜单会隐藏工具条或者是出现工具条,想在工具条上点击右键是不能让它弹出菜单,QMainWindow的设置this->setContextMenuPolicy(Qt::NoContextMenu); 阅读全文
posted @ 2013-03-31 15:23
奥雷连诺
阅读(214)
评论(0)
推荐(0)
摘要:
在项目中遇到了这样的问题,是在使用过滤模型的时候。。在更新模型的时候,当过滤模型删除重新new,而源模型没有重新new后,使用setColumnWidth(intcolumn,intwidth),;就会不起作用。后来我试着不再重新new过滤模型,setColumnWidth就可以使用了。难道过滤模型... 阅读全文
posted @ 2013-03-31 15:22
奥雷连诺
阅读(269)
评论(0)
推荐(0)
摘要:
m_pTable->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); 阅读全文
posted @ 2013-03-31 15:22
奥雷连诺
阅读(307)
评论(0)
推荐(0)

浙公网安备 33010602011771号